Documentation
¶
Index ¶
- Constants
- type MatchRule
- type Mock
- func (m *Mock) Close()
- func (m *Mock) DefaultSpec() interface{}
- func (m *Mock) Description() string
- func (m *Mock) Handle(ctx context.HTTPContext) string
- func (m *Mock) Inherit(filterSpec *httppipeline.FilterSpec, previousGeneration httppipeline.Filter)
- func (m *Mock) Init(filterSpec *httppipeline.FilterSpec)
- func (m *Mock) Kind() string
- func (m *Mock) Results() []string
- func (m *Mock) Status() interface{}
- type Rule
- type Spec
Constants ¶
View Source
const (
// Kind is the kind of Mock.
Kind = "Mock"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MatchRule ¶ added in v1.4.1
type MatchRule struct {
Path string `yaml:"path,omitempty" jsonschema:"omitempty,pattern=^/"`
PathPrefix string `yaml:"pathPrefix,omitempty" jsonschema:"omitempty,pattern=^/"`
Headers map[string]*urlrule.StringMatch `yaml:"headers" jsonschema:"omitempty"`
MatchAllHeaders bool `yaml:"matchAllHeaders" jsonschema:"omitempty"`
}
MatchRule is the rule to match a request
type Mock ¶
type Mock struct {
// contains filtered or unexported fields
}
Mock is filter Mock.
func (*Mock) DefaultSpec ¶
func (m *Mock) DefaultSpec() interface{}
DefaultSpec returns default spec of Mock.
func (*Mock) Description ¶
Description returns the description of Mock.
func (*Mock) Handle ¶
func (m *Mock) Handle(ctx context.HTTPContext) string
Handle mocks HTTPContext.
func (*Mock) Inherit ¶
func (m *Mock) Inherit(filterSpec *httppipeline.FilterSpec, previousGeneration httppipeline.Filter)
Inherit inherits previous generation of Mock.
type Rule ¶
type Rule struct {
Match MatchRule `yaml:"match" jsonschema:"required"`
Code int `yaml:"code" jsonschema:"required,format=httpcode"`
Headers map[string]string `yaml:"headers" jsonschema:"omitempty"`
Body string `yaml:"body" jsonschema:"omitempty"`
Delay string `yaml:"delay" jsonschema:"omitempty,format=duration"`
// contains filtered or unexported fields
}
Rule is the mock rule.
Click to show internal directories.
Click to hide internal directories.