PreconditionExtractor<'E> Type
Registers an extractor for PreCondition or OverridablePreCondition fields.
Create with Extractor.precondition. Each call registers extractors for both
PreCondition<T> and OverridablePreCondition<T>.
Each precondition type used in routes must have a corresponding extractor registered in EndpointConfig.
Example
let config: EndpointConfig<AppError> = {
Preconditions = [
yield! Extractor.precondition<UserId, _> (fun ctx ->
match getAuthCookie ctx with
| Some id -> Ok id
| None -> Error NotAuthenticated)
]
// ... other config
}
val config: 'a
union case Option.Some: Value: 'T -> Option<'T>
val id: x: 'T -> 'T
union case Result.Ok: ResultValue: 'T -> Result<'T,'TError>
union case Option.None: Option<'T>
union case Result.Error: ErrorValue: 'TError -> Result<'T,'TError>
Record fields
| Record Field |
Description
|
|
Extract the value from HTTP context
|
The marker type this extracts (e.g., typeof
|
Falco.UnionRoutes