View Source Twirp.Plug (Twirp Elixir v0.1.1)

Provides a plug that takes service and handler module. If the request is directed at the "twirp" endpoint then the plug will intercept the conn and process it. Otherwise it allows the conn to pass through. This is a deviation from the twirp specification but it allows users to include twirp services into their existing plug stacks.

You can use the plug like so:

plug Twirp.Plug,
  service: MyService,
  handler: MyHandler,

Summary

Functions

Link to this function

call_before_hooks(env, conn, hooks)

View Source
Link to this function

call_on_error_hooks(hooks, env, error)

View Source
Link to this function

call_on_exception_hooks(hooks, env, exception)

View Source
Link to this function

call_on_success_hooks(env, hooks)

View Source
Link to this function

validate_req(conn, method, map)

View Source