Copyright | (c) 2011 MailRank Inc. |
---|---|
License | Apache |
Maintainer | Tim McGilchrist <timmcgil@gmail.com>, Mark Hibberd <mark@hibberd.id.au>, Nathan Hunter <nhunter@janrain.com> |
Stability | experimental |
Portability | portable |
Safe Haskell | None |
Language | Haskell98 |
Network.Riak.Escape
Description
Support for REST-safe name handling.
Riak's protocol buffer (PBC) API will accept unescaped bucket, link, and key names. Its REST API does not unescape names, so it is possible to use the PBC API to construct names that cannot be accessed via the REST API (e.g. containing an embedded slash or other URL-unsafe octet).
Synopsis
- class Escape e where
- escape :: e -> ByteString
- unescape' :: ByteString -> Either String e
- unescape :: Escape e => ByteString -> e
Documentation
The class of string-like types that can be URL-escaped and unescaped.
Methods
escape :: e -> ByteString Source #
URL-escape a string.
unescape' :: ByteString -> Either String e Source #
URL-unescape a string.
Instances
Escape ByteString Source # | |
Defined in Network.Riak.Escape Methods escape :: ByteString -> ByteString0 Source # unescape' :: ByteString0 -> Either String ByteString Source # | |
Escape ByteString Source # | |
Defined in Network.Riak.Escape Methods escape :: ByteString -> ByteString Source # unescape' :: ByteString -> Either String ByteString Source # | |
Escape Text Source # | |
Defined in Network.Riak.Escape | |
Escape Text Source # | |
Defined in Network.Riak.Escape | |
Escape [Char] Source # | |
Defined in Network.Riak.Escape |
unescape :: Escape e => ByteString -> e Source #
URL-unescape a string that is presumed to be properly escaped. If the string is invalid, an error will be thrown that cannot be caught from pure code.