Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BodyMatch ¶
type BodyMatch struct {
// contains filtered or unexported fields
}
BodyMatch demonstrates a BodyMatch plugin.
type Config ¶
type Config struct {
Body []SingleBody
Response ResponseError
}
Config the plugin configuration.
func CreateConfig ¶
func CreateConfig() *Config
CreateConfig creates the default plugin configuration.
type MatchType ¶
type MatchType string
MatchType defines an enum which can be used to specify the match type for the 'contains' config.
type ResponseError ¶
type ResponseError struct {
Code string `json:"code,omitempty"`
Message string `json:"message,omitempty"`
Status int `json:"status,omitempty"`
Raw string `json:"raw,omitempty"`
}
ResponseError contains a failuer message
func (*ResponseError) GetMessage ¶
func (resErr *ResponseError) GetMessage() string
GetMessage get response message
func (*ResponseError) Response ¶
func (resErr *ResponseError) Response(rw http.ResponseWriter)
Response write error response to client
type SingleBody ¶
type SingleBody struct {
Name string `json:"name,omitempty"`
Values []string `json:"values,omitempty"`
MatchType string `json:"matchtype,omitempty"`
Required *bool `json:"required,omitempty"`
Contains *bool `json:"contains,omitempty"`
URLDecode *bool `json:"urldecode,omitempty"`
}
SingleBody contains a single body keypair
func (*SingleBody) IsContains ¶
func (s *SingleBody) IsContains() bool
IsContains checks whether a body value should contain the configured value
func (*SingleBody) IsRequired ¶
func (s *SingleBody) IsRequired() bool
IsRequired checks whether a body is mandatory in the request, defaults to 'true'
Click to show internal directories.
Click to hide internal directories.