Idris2Doc : Stellar.HTTP.DSL

Stellar.HTTP.DSL

(source)

Reexports

import public Data.Buffer
import public Stellar.API.Maybe
import public JSON.Simple.Derive

Definitions

fromBool : Bool -> Maybe ()
Visibility: export
interface Parsable : Type -> Type
Parameters: t
Methods:
parse : String -> Maybe t

Implementations:
Parsable Int
Parsable Integer
Parsable Nat
Parsable String
parse : Parsable t => String -> Maybe t
Visibility: public export
interface Serializable : Type -> Type
Parameters: t
Methods:
toBuffer : t -> IO (Int, Buffer)

Implementations:
Serializable ()
Serializable String
Serializable JSON
toBuffer : Serializable t => t -> IO (Int, Buffer)
Visibility: public export
interface Deserializable : Type -> Type
Parameters: t
Methods:
fromBuffer : Buffer -> Maybe t

Implementations:
Deserializable String
Deserializable JSON
fromBuffer : Deserializable t => Buffer -> Maybe t
Visibility: public export
record NameTy : Type
Totality: total
Visibility: public export
Constructor: 
(:>) : String -> (ty : Type) -> Parsable ty => NameTy

Projections:
.name : NameTy -> String
.p : ({rec:0} : NameTy) -> Parsable (ty {rec:0})
.ty : NameTy -> Type
.name : NameTy -> String
Visibility: public export
name : NameTy -> String
Visibility: public export
.ty : NameTy -> Type
Visibility: public export
ty : NameTy -> Type
Visibility: public export
.p : ({rec:0} : NameTy) -> Parsable (ty {rec:0})
Visibility: public export
Fixity Declaration: infixl operator, level 8
p : ({rec:0} : NameTy) -> Parsable (ty {rec:0})
Visibility: public export
Fixity Declaration: infixl operator, level 8
data ParsableQueryParam : Type
Totality: total
Visibility: public export
Constructors:
Nil : ParsableQueryParam
(::) : NameTy -> ParsableQueryParam -> ParsableQueryParam
QueryType : ParsableQueryParam -> List Type
Visibility: public export
data ContentType : Type
Totality: total
Visibility: public export
Constructors:
JSON : ContentType
Plain : ContentType
PDF : ContentType
interface RequestParser : API -> Type
Parameters: c
Constructor: 
MkRequestParser

Methods:
parseReq : PlainRequest -> Either String (c .message)
mkRes : (inp : c .message) -> c .response inp -> IO PlainResponse
parseReq : RequestParser c => PlainRequest -> Either String (c .message)
Visibility: public export
mkRes : RequestParser c => (inp : c .message) -> c .response inp -> IO PlainResponse
Visibility: public export
parseGeneric : ToJSON t => FromJSON argBody => (m : Method) -> (WFURL -> Maybe argURL) -> (argURL -> DepBody m argBody -> finalResult) -> JSONHTTP =&> Maybe (finalResult :- t)
  A helper to parse a GET request given a function that parses the URL and the request body

Visibility: export
parsePost : ToJSON t => FromJSON argBody => (WFURL -> Maybe argURL) -> (argURL -> argBody -> finalResult) -> JSONHTTP =&> Maybe (finalResult :- t)
  A helper to parse a GET request given a function that parses the URL and the body

Visibility: export
parsePost' : ToJSON t => FromJSON argBody => (WFURL -> Bool) -> JSONHTTP =&> Maybe (argBody :- t)
  A helper to parse a GET request given a function that matches the URL and parses the body from JSON

Visibility: export
parsePut : ToJSON t => FromJSON argBody => (WFURL -> Maybe argURL) -> (argURL -> argBody -> finalResult) -> JSONHTTP =&> Maybe (finalResult :- t)
  A helper to parse a GET request given a function that parses the URL and the body

Visibility: export
parsePut' : ToJSON t => FromJSON argBody => (WFURL -> Bool) -> JSONHTTP =&> Maybe (argBody :- t)
  A helper to parse a GET request given a function that matches the URL and parses the body from JSON

Visibility: export
parseDelete : ToJSON t => FromJSON argBody => (WFURL -> Maybe argURL) -> JSONHTTP =&> Maybe (argURL :- t)
  A helper to parse a GET request given a function that matches the URL and parses the body from JSON

Visibility: export
parseGet : ToJSON t => (WFURL -> Maybe arg) -> JSONHTTP =&> Maybe (arg :- t)
  A helper to parse a GET request given a function that parses the URL

Visibility: export
parseGet' : ToJSON t => FromJSON argBody => (WFURL -> Bool) -> JSONHTTP =&> Maybe (() :- t)
  A helper to parse a GET request given a function that matches on the URL

Visibility: export
rootPath : Path
  Root of the file system "/".

Visibility: export
isRoot : WFURL -> Bool
Visibility: export
parsePath : Path -> WFURL -> Bool
Visibility: export
asURL : PlainHTTP =&> Maybe RichHTTP
  parse the URL of an HTTP request into its own URL type for further analysis

Visibility: export
hasHeader : (String, String) -> RichRequest b -> Maybe (RichRequest b)
  Ensures a request has a specific header
Returns the request if it does, returns `Nothign` otherwise

Visibility: export
hasJSONBody : RichRequest Buffer -> Maybe (RichRequest JSON)
  Parse a request body as JSON, does not check for `content-type=application/json`

Visibility: export
parseJSONBody : FromJSON a => RichRequest Buffer -> Maybe (RichRequest a)
  Parse a request body as JSON, does not check for `content-type=application/json`

Visibility: export
hasJSONBodyContentType : RichRequest Buffer -> Maybe (RichRequest JSON)
  Parses a request body as JSON, checks for `content-type=application/json`

Visibility: export
asJSON : RichHTTP =&> Maybe JSONHTTP
  Convert the request body into JSON. Checks for content-type: application/json header

Visibility: export
httpJSON : PlainHTTP =&> Maybe JSONHTTP
  Convert all requests and responses are ones that manipulate JSON

Visibility: export
httpJSONBody : PlainHTTP =&> Maybe JSONHTTP
  Return bad request if the request could not be parsed

Visibility: export
execJSON : Costate (IO $- JSONHTTP) -> Costate (IO $- PlainHTTP)
  Convert an execution for JSON-bodied requests to general HTTP requests

Visibility: export
asJSON : RichHTTP =&> Maybe JSONHTTP
  Convert the request body into a JSON value, do not check for content-type header

Visibility: export
httpJSON : PlainHTTP =&> Maybe JSONHTTP
  Convert all requests and responses are ones that manipulate JSON, does not check for content-type header

Visibility: export
httpJSONBody : PlainHTTP =&> Maybe JSONHTTP
  Return bad request if the request could not be parsed

Visibility: export
execJSON : Costate (IO $- JSONHTTP) -> Costate (IO $- PlainHTTP)
  Convert an execution for JSON-bodied requests to general HTTP requests

Visibility: export
0 GenHTTP : FromJSON a => ToJSON b => API
Visibility: public export
asJSON : {auto frjson : FromJSON a} -> {auto tojson : ToJSON b} -> RichHTTP =&> Maybe GenHTTP
  Convert the request body into a JSON value, do not check for content-type header

Visibility: export
httpJSON : {auto frjson : FromJSON a} -> {auto tojson : ToJSON b} -> PlainHTTP =&> Maybe GenHTTP
  Convert all requests and responses are ones that manipulate JSON, does not check for content-type header

Visibility: export
httpJSONBody : {auto frjson : FromJSON a} -> {auto tojson : ToJSON b} -> PlainHTTP =&> Maybe GenHTTP
  Return bad request if the request could not be parsed

Visibility: export
execJSON : {auto frjson : FromJSON a} -> {auto tojson : ToJSON b} -> Costate (IO $- GenHTTP) -> Costate (IO $- PlainHTTP)
  Convert an execution for JSON-bodied requests to general HTTP requests

Visibility: export