Safe Haskell | None |
---|
- data ResourceConfig m = ResourceConfig {
- readLimit :: Maybe Int
- maxRequestBodySize :: Int64
- onHeaderFailure :: m ()
- onPathFailure :: m ()
- onQueryFailure :: m ()
- onLookupFailure :: m ()
- onMethodFailure :: m ()
- onAcceptFailure :: m ()
- onContentTypeFailure :: m ()
- onContentParseFailure :: m ()
- defaultConfig :: MonadSnap m => Int64 -> ResourceConfig m
- class HasResourceConfig b where
- resourceLens :: SnapletLens (Snaplet b) (ResourceConfig (Handler b b))
- type Resources b = ResourceConfig (Handler b b)
- resourceInit :: ResourceConfig (Handler b b) -> SnapletInit b (Resources b)
- resourceInitDefault :: Int64 -> SnapletInit b (Resources b)
- getResourceConfig :: HasResourceConfig b => Handler b v (ResourceConfig (Handler b b))
Configuration
data ResourceConfig m Source
Configuration data.
ResourceConfig | |
|
defaultConfig :: MonadSnap m => Int64 -> ResourceConfig mSource
The default configuration settings. Requires a value for the maximum size of a request body.
defaultConfig mrbs = ResourceConfig { readLimit = Nothing , maxRequestBodySize = mrbs , on*Failure = write "reason" }
Snaplet type class
class HasResourceConfig b whereSource
The type class for an implementing Snaplet.
resourceLens :: SnapletLens (Snaplet b) (ResourceConfig (Handler b b))Source
Retrieve the configuration from the Snaplet monad.
type Resources b = ResourceConfig (Handler b b)Source
Convenience alias of ResourceConfig
.
resourceInit :: ResourceConfig (Handler b b) -> SnapletInit b (Resources b)Source
Initialize the resource snaplet with the given configuration.
resourceInitDefault :: Int64 -> SnapletInit b (Resources b)Source
Initialize the resource snaplet with the default configuration.
Local utility
getResourceConfig :: HasResourceConfig b => Handler b v (ResourceConfig (Handler b b))Source
Returns the resource configuration.