Documentation ¶
Index ¶
- Constants
- Variables
- func IsErrSetValue(err error) bool
- type Body
- func (b *Body) Delete(key string) error
- func (b *Body) Iterate(callback func(key string, value interface{}) error) error
- func (b *Body) Name() string
- func (b *Body) Parse(req *retryablehttp.Request) (bool, error)
- func (b *Body) Rebuild() (*retryablehttp.Request, error)
- func (b *Body) SetValue(key string, value string) error
- type Component
- type Cookie
- func (c *Cookie) Delete(key string) error
- func (c *Cookie) Iterate(callback func(key string, value interface{}) error) error
- func (c *Cookie) Name() string
- func (c *Cookie) Parse(req *retryablehttp.Request) (bool, error)
- func (c *Cookie) Rebuild() (*retryablehttp.Request, error)
- func (c *Cookie) SetValue(key string, value string) error
- type Header
- func (q *Header) Delete(key string) error
- func (q *Header) Iterate(callback func(key string, value interface{}) error) error
- func (q *Header) Name() string
- func (q *Header) Parse(req *retryablehttp.Request) (bool, error)
- func (q *Header) Rebuild() (*retryablehttp.Request, error)
- func (q *Header) SetValue(key string, value string) error
- type Path
- func (q *Path) Delete(key string) error
- func (q *Path) Iterate(callback func(key string, value interface{}) error) error
- func (q *Path) Name() string
- func (q *Path) Parse(req *retryablehttp.Request) (bool, error)
- func (q *Path) Rebuild() (*retryablehttp.Request, error)
- func (q *Path) SetValue(key string, value string) error
- type Query
- func (q *Query) Delete(key string) error
- func (q *Query) Iterate(callback func(key string, value interface{}) error) error
- func (q *Query) Name() string
- func (q *Query) Parse(req *retryablehttp.Request) (bool, error)
- func (q *Query) Rebuild() (*retryablehttp.Request, error)
- func (q *Query) SetValue(key string, value string) error
- type Value
Constants ¶
View Source
const ( // RequestBodyComponent is the name of the request body component RequestBodyComponent = "body" // RequestQueryComponent is the name of the request query component RequestQueryComponent = "query" // RequestPathComponent is the name of the request url component RequestPathComponent = "path" // RequestHeaderComponent is the name of the request header component RequestHeaderComponent = "header" // RequestCookieComponent is the name of the request cookie component RequestCookieComponent = "cookie" )
Variables ¶
View Source
var Components = []string{ RequestBodyComponent, RequestQueryComponent, RequestPathComponent, RequestHeaderComponent, RequestCookieComponent, }
Components is a list of all available components
View Source
var ErrKeyNotFound = errors.New("key not found")
ErrKeyNotFound is a error raised when a key is not found
View Source
var ErrSetValue = errors.New("could not set value")
ErrSetValue is a error raised when a value cannot be set
Functions ¶
func IsErrSetValue ¶
Types ¶
type Body ¶
type Body struct {
// contains filtered or unexported fields
}
Body is a component for a request body
type Component ¶
type Component interface { // Name returns the name of the component Name() string // Parse parses the component and returns the // parsed component Parse(req *retryablehttp.Request) (bool, error) // Iterate iterates over all values of a component // ex in case of query component, it will iterate over each query parameter // depending on the rule if mode is single // request is rebuilt for each value in this callback // and in case of multiple, request will be rebuilt after iteration of all values Iterate(func(key string, value interface{}) error) error // SetValue sets a value in the component // for a key // // After calling setValue for mutation, the value must be // called again so as to reset the body to its original state. SetValue(key string, value string) error // Delete deletes a key from the component // If it is applicable Delete(key string) error // Rebuild returns a new request with the // component rebuilt Rebuild() (*retryablehttp.Request, error) }
Component is a component for a request
type Cookie ¶
type Cookie struct {
// contains filtered or unexported fields
}
Cookie is a component for a request cookie
type Header ¶
type Header struct {
// contains filtered or unexported fields
}
Header is a component for a request header
type Path ¶
type Path struct {
// contains filtered or unexported fields
}
Path is a component for a request Path
type Query ¶
type Query struct {
// contains filtered or unexported fields
}
Query is a component for a request query
type Value ¶
type Value struct {
// contains filtered or unexported fields
}
Value is a value component containing a single parameter for the component
It is a type of container that is used to represent all the data values that are used in a request.
func (*Value) SetParsedValue ¶
SetParsedValue sets the parsed value for a key in the parsed map
Source Files ¶
Click to show internal directories.
Click to hide internal directories.