Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidHTTPMethod = errors.New("invalid HTTP method")
View Source
var ErrInvalidHeaderName = errors.New("invalid header name")
View Source
var ErrInvalidStatusCode = errors.New("invalid HTTP response status code")
View Source
var ErrMinGreaterMax = errors.New("min greater than max")
View Source
var ErrNoEffect = errors.New("no effect")
Functions ¶
Types ¶
type GlobExpression ¶
type GlobExpression struct {
// contains filtered or unexported fields
}
func NewGlobExpression ¶
func NewGlobExpression(expression string) (GlobExpression, error)
func (*GlobExpression) Match ¶
func (g *GlobExpression) Match(s string) bool
func (GlobExpression) String ¶
func (e GlobExpression) String() string
func (*GlobExpression) UnmarshalText ¶
func (g *GlobExpression) UnmarshalText(text []byte) (err error)
type GlobMap ¶
type GlobMap[T any] map[GlobExpression]T
type HTTPMethod ¶
type HTTPMethod string
func (*HTTPMethod) UnmarshalText ¶
func (m *HTTPMethod) UnmarshalText(text []byte) error
type HeaderName ¶
type HeaderName string
func (HeaderName) Validate ¶
func (n HeaderName) Validate() error
type Replace ¶
type Replace struct {
StatusCode StatusCode `yaml:"status-code"`
Body *string `yaml:"body"`
Headers map[HeaderName]string `yaml:"headers"`
}
type Resource ¶
type Resource struct {
Methods []HTTPMethod `yaml:"methods"`
Path GlobExpression `yaml:"path"`
Headers GlobMap[[]GlobExpression] `yaml:"headers"`
Query GlobMap[[]GlobExpression] `yaml:"query"`
Effect *Effect `yaml:"effect"`
}
type StatusCode ¶
type StatusCode int32
func (StatusCode) Validate ¶
func (c StatusCode) Validate() error
Click to show internal directories.
Click to hide internal directories.