View Source simpler_cowboy_rest behaviour (simpler_cowboy_rest v1.0.0)

Summary

Callbacks

Link to this callback

allow_missing_post/2

View Source (optional)
-callback allow_missing_post(Req, State) -> {Result, Req, State} when Result :: boolean() | stop.
Link to this callback

allowed_methods/2

View Source (optional)
-callback allowed_methods(Req, State) -> {Result, Req, State} when Result :: [binary()] | stop.
Link to this callback

content_types_accepted/2

View Source (optional)
-callback content_types_accepted(Req, State) -> {Result, Req, State}
                                    when
                                        Result :: [{binary() | ParsedMime, AcceptCallback :: atom()}] | stop,
                                        ParsedMime :: {Type :: binary(), SubType :: binary(), '*' | Params},
                                        Params :: [{Key :: binary(), Value :: binary()}].
Link to this callback

content_types_provided/2

View Source (optional)
-callback content_types_provided(Req, State) -> {Result, Req, State}
                                    when
                                        Result ::
                                            [{binary() | ParsedMime, ProvideCallback :: atom()}] | stop,
                                        ParsedMime :: {Type :: binary(), SubType :: binary(), '*' | Params},
                                        Params :: [{Key :: binary(), Value :: binary()}].
-callback delete(Req, State) -> {Result, Req, State} when Result :: boolean() | stop.
Link to this callback

delete_resource/2

View Source (optional)
-callback delete_resource(Req, State) -> {Result, Req, State} when Result :: boolean() | stop.
-callback forbidden(Req, State) -> {Result, Req, State} when Result :: boolean() | stop.
-callback get(Req, State) -> {Result, Req, State} when Result :: cowboy_req:resp_body() | stop.
-callback init(Req, State) -> {Result, Req, State} when Result :: cowboy_rest.
Link to this callback

is_authorized/2

View Source (optional)
-callback is_authorized(Req, State) -> {Result, Req, State}
                           when Result :: true | {false, AuthHeader :: iodata()} | stop.
-callback post(Req, State) -> {Result, Req, State}
                  when Result :: true | {true, URI :: iodata()} | false | stop.
-callback put(Req, State) -> {Result, Req, State}
                 when Result :: true | {true, URI :: iodata()} | false | stop.
Link to this callback

resource_exists/2

View Source (optional)
-callback resource_exists(Req, State) -> {Result, Req, State} when Result :: boolean() | stop.
Link to this callback

service_available/2

View Source (optional)
-callback service_available(Req, State) -> {Result, Req, State} when Result :: boolean() | stop.

Functions

Link to this function

allow_missing_post(Req, State)

View Source
Link to this function

allow_missing_post(_, Req, State)

View Source
Link to this function

allowed_methods(Req, State)

View Source
Link to this function

allowed_methods(_, Req, State)

View Source
Link to this function

content_types_accepted(Req, State)

View Source
Link to this function

content_types_accepted(_, Req, State)

View Source
Link to this function

content_types_provided(Req, State)

View Source
Link to this function

content_types_provided(_, Req0, State0)

View Source
Link to this function

delete_resource(Req, State)

View Source
Link to this function

forbidden(_, Req, State)

View Source
Link to this function

is_authorized(Req, State)

View Source
Link to this function

is_authorized(_, Req, State)

View Source
Link to this function

resource_exists(Req, State)

View Source
Link to this function

resource_exists(_, Req, State)

View Source
Link to this function

service_available(Req, State)

View Source
Link to this function

service_available(_, Req, State)

View Source
Link to this function

start(Routes0, TransOpts)

View Source