Curator.SessionKeeper v0.1.0 Curator.SessionKeeper.Plug.EnsureResource

This plug ensures that the current_resource has been set, usually in Curator.SessionKeeper.Plug.LoadResource.

If one is not found, the no_resource/2 function is invoked with the Plug.Conn.t object and its params.

Example

# Will call the no_resource/2 function on your handler
plug Curator.SessionKeeper.Plug.EnsureResource, handler: SomeModule

# look in the :secret location.
plug Curator.SessionKeeper.Plug.EnsureResource, handler: SomeModule, key: :secret

If the handler option is not passed, Curator.SessionKeeper.Plug.ErrorHandler will provide the default behavior.