Documentation
¶
Index ¶
- func GetVersion() string
- func InitLogger()
- type AppArguments
- type ErrorConfig
- type HostConfig
- type HostsConfig
- func (h *HostsConfig) DeleteHostConfig(host string)
- func (h *HostsConfig) DeleteHostErrorConfig(host, errorCode string) (*HostConfig, error)
- func (h *HostsConfig) DeleteHostLatencyConfig(host string) (*HostConfig, error)
- func (h *HostsConfig) GetAppropriateErrorsConfig(host, uri string) *map[string]ErrorConfig
- func (h *HostsConfig) GetAppropriateLatencyConfig(host, uri string) *LatencyConfig
- func (h *HostsConfig) GetHostConfig(host string) *HostConfig
- func (h *HostsConfig) SetHostConfig(host string, newConfig HostConfig)
- func (h *HostsConfig) UpdateHostErrorsConfig(host string, errorsConfig map[string]ErrorConfig) (*HostConfig, error)
- func (h *HostsConfig) UpdateHostLatencyConfig(host string, latencyConfig *LatencyConfig) (*HostConfig, error)
- func (h *HostsConfig) UpdateHostUrisConfig(host string, urisConfig map[string]UriConfig) (*HostConfig, error)
- func (h *HostsConfig) Validate() error
- type LatencyConfig
- type MocksDirectoryConfig
- type UriConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetVersion ¶
func GetVersion() string
func InitLogger ¶ added in v1.2.0
func InitLogger()
Types ¶
type AppArguments ¶ added in v1.2.0
type AppArguments struct {
MocksDirectory string `arg:"required,--mocks-directory" help:"path to the mocks directory"`
MocksConfigFile string `arg:"--mocks-config-file" help:"path to the config file"`
DefaultContentType string `` /* 130-byte string literal not displayed */
ServerPort int `default:"8080" arg:"-P,--port" help:"port to be used"`
DisableCache bool `arg:"--disable-cache" help:"disable the caching"`
DisableLatency bool `arg:"--disable-latency" help:"disable latency simulation"`
DisableError bool `arg:"--disable-error" help:"disable error simulation"`
DisableCors bool `arg:"--disable-cors" help:"disable CORS headers"`
}
func ParseAppArguments ¶ added in v1.2.0
func ParseAppArguments() *AppArguments
type ErrorConfig ¶
type ErrorConfig struct {
Percentage *int `json:"percentage"`
LatencyConfig *LatencyConfig `json:"latency"`
}
type HostConfig ¶
type HostConfig struct {
LatencyConfig *LatencyConfig `json:"latency"`
ErrorsConfig map[string]ErrorConfig `json:"errors"`
UrisConfig map[string]UriConfig `json:"uris"`
}
func (*HostConfig) Validate ¶
func (h *HostConfig) Validate() error
type HostsConfig ¶
type HostsConfig struct {
Hosts map[string]HostConfig `json:"hosts"`
}
func NewHostsConfig ¶ added in v1.2.0
func NewHostsConfig(appArguments *AppArguments) (*HostsConfig, error)
func (*HostsConfig) DeleteHostConfig ¶ added in v1.2.0
func (h *HostsConfig) DeleteHostConfig(host string)
func (*HostsConfig) DeleteHostErrorConfig ¶ added in v1.2.0
func (h *HostsConfig) DeleteHostErrorConfig(host, errorCode string) (*HostConfig, error)
func (*HostsConfig) DeleteHostLatencyConfig ¶ added in v1.2.0
func (h *HostsConfig) DeleteHostLatencyConfig(host string) (*HostConfig, error)
func (*HostsConfig) GetAppropriateErrorsConfig ¶
func (h *HostsConfig) GetAppropriateErrorsConfig(host, uri string) *map[string]ErrorConfig
func (*HostsConfig) GetAppropriateLatencyConfig ¶
func (h *HostsConfig) GetAppropriateLatencyConfig(host, uri string) *LatencyConfig
func (*HostsConfig) GetHostConfig ¶ added in v1.2.0
func (h *HostsConfig) GetHostConfig(host string) *HostConfig
func (*HostsConfig) SetHostConfig ¶ added in v1.2.0
func (h *HostsConfig) SetHostConfig(host string, newConfig HostConfig)
func (*HostsConfig) UpdateHostErrorsConfig ¶ added in v1.2.0
func (h *HostsConfig) UpdateHostErrorsConfig(host string, errorsConfig map[string]ErrorConfig) (*HostConfig, error)
func (*HostsConfig) UpdateHostLatencyConfig ¶ added in v1.2.0
func (h *HostsConfig) UpdateHostLatencyConfig(host string, latencyConfig *LatencyConfig) (*HostConfig, error)
func (*HostsConfig) UpdateHostUrisConfig ¶ added in v1.2.0
func (h *HostsConfig) UpdateHostUrisConfig(host string, urisConfig map[string]UriConfig) (*HostConfig, error)
func (*HostsConfig) Validate ¶
func (h *HostsConfig) Validate() error
type LatencyConfig ¶
type MocksDirectoryConfig ¶
type MocksDirectoryConfig struct {
Path string
}
func NewMocksDirectoryConfig ¶ added in v1.2.0
func NewMocksDirectoryConfig(appArguments *AppArguments) (*MocksDirectoryConfig, error)
type UriConfig ¶
type UriConfig struct {
LatencyConfig *LatencyConfig `json:"latency"`
ErrorsConfig map[string]ErrorConfig `json:"errors"`
}
Click to show internal directories.
Click to hide internal directories.