Twirp v0.4.1 Twirp.Plug View Source

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,

Link to this section Summary

Link to this section 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