package
Version:
v0.0.5
Opens a new window with list of versions in this module.
Published: Apr 2, 2021
License: Apache-2.0
Opens a new window with license information.
Imports: 8
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
¶
body
The body
predicate checks the Content-Type of the incoming request
and/or parse its body.
Options
Option |
Required |
Description |
mime |
|
If set, check that the Mime type of the Content-Type header value of the incoming request matches this value |
type |
|
Can be string or json . If set, the body is read and parsed accordingly to this value. |
limit |
|
Max body size in bytes. If received body is larger, it will be truncated. Default is 1232896 (1Mb). |
Results
Field |
Type |
Description |
result |
boolean |
false if mime was not matched (if set) or body cannot be parsed accordingly to type (if set) or method is GET, HEAD or DELETE |
payload |
depends on type |
It type is set, contains the parsed body |
Example:
- body:
mime: application/json
type: json
register: body
- log:
msg: body.payload.token
Documentation
¶
New returns a new Predicate
type Predicate struct {
}
Predicate is a genapid.Predicate interface that describes the predicate
Call evaluates the predicate
Name returns the name of the predicate
func (predicate *Predicate) Params() interface{}
Params returns a reference to a struct params accepted by the predicate
Result returns data set by the predicate
Source Files
¶
Click to show internal directories.
Click to hide internal directories.