Documentation
¶
Index ¶
Constants ¶
View Source
const ( ResponseSequentially responseMode = "sequential" ResponseRandomly responseMode = "random" DefaultResponse responseMode = "" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Mock ¶
type Mock struct {
ID string `yaml:"id,omitempty" json:"id,omitempty"`
Name string `yaml:"name,omitempty" json:"name,omitempty"`
Port string `yaml:"port,omitempty" json:"port,omitempty"`
Routes []*Route `yaml:"routes,omitempty" json:"routes,omitempty"`
Proxy *Proxy `yaml:"proxy,omitempty" json:"proxy,omitempty"`
// all OPTIONS calls are responded with success if AutoCORS is true
AutoCORS bool `yaml:"auto_cors,omitempty" json:"auto_cors,omitempty"`
TLS *TLS `yaml:"tls,omitempty" json:"tls,omitempty"`
FilePath string `yaml:"-" json:"-"`
// contains filtered or unexported fields
}
func (Mock) ApplyDefault ¶ added in v0.0.35
func (Mock) ProxyEnabled ¶
func (Mock) TLSEnabled ¶ added in v0.0.17
type Proxy ¶
type Proxy struct {
Enabled bool `yaml:"enabled,omitempty" json:"enabled,omitempty"`
Host string `yaml:"host,omitempty" json:"host"`
RequestHeaders map[string]string `yaml:"request_headers,omitempty" json:"request_headers,omitempty"`
ResponseHeaders map[string]string `yaml:"response_headers,omitempty" json:"response_headers,omitempty"`
InsecureSkipVerify bool `yaml:"insecure_skip_verify,omitempty" json:"insecure_skip_verify,omitempty"`
}
type Response ¶
type Response struct {
ID string `yaml:"id,omitempty" json:"id,omitempty"`
Status int `yaml:"status" json:"status,omitempty"`
Delay Delay `yaml:"delay,omitempty" json:"delay,omitempty"`
Headers map[string]string `yaml:"headers,omitempty" json:"headers,omitempty"`
Body string `yaml:"body,omitempty" json:"body,omitempty"`
FilePath string `yaml:"file_path,omitempty" json:"file_path,omitempty"`
RuleAggregation RuleAggregation `yaml:"rule_aggregation,omitempty" json:"rule_aggregation,omitempty"`
Rules []Rule `yaml:"rules,omitempty" json:"rules,omitempty"`
IsDefault bool `yaml:"is_default,omitempty" json:"is_default,omitempty"`
}
type Route ¶
type Route struct {
ID string `yaml:"id,omitempty" json:"id,omitempty"`
Method string `yaml:"method" json:"method"`
Path string `yaml:"path" json:"path"`
Description string `yaml:"description" json:"description"`
ResponseMode responseMode `yaml:"response_mode,omitempty" json:"response_mode,omitempty"`
Responses []Response `yaml:"responses" json:"responses"`
Disabled bool `yaml:"disabled,omitempty" json:"disabled,omitempty"`
}
type Rule ¶
type RuleAggregation ¶
type RuleAggregation string
const ( Or RuleAggregation = "or" And RuleAggregation = "and" )
Click to show internal directories.
Click to hide internal directories.