Documentation
¶
Index ¶
- func DeleteHostConfig(host string) error
- func GetVersion() string
- func SetHostConfig(host string, newConfig HostConfig) error
- type AppConfig
- type ErrorConfig
- type HostConfig
- func DeleteHostErrorConfig(host, errorCode string) (*HostConfig, error)
- func DeleteHostLatencyConfig(host string) (*HostConfig, error)
- func GetHostConfig(host string) (*HostConfig, error)
- func UpdateHostErrorsConfig(host string, errorsConfig map[string]ErrorConfig) (*HostConfig, error)
- func UpdateHostLatencyConfig(host string, latencyConfig *LatencyConfig) (*HostConfig, error)
- func UpdateHostUrisConfig(host string, urisConfig map[string]UriConfig) (*HostConfig, error)
- type HostsConfig
- type LatencyConfig
- type MocksDirectoryConfig
- type UriConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteHostConfig ¶
func GetVersion ¶
func GetVersion() string
func SetHostConfig ¶
func SetHostConfig(host string, newConfig HostConfig) error
Types ¶
type AppConfig ¶
type AppConfig 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"`
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"`
}
func GetAppConfig ¶
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 DeleteHostErrorConfig ¶
func DeleteHostErrorConfig(host, errorCode string) (*HostConfig, error)
func DeleteHostLatencyConfig ¶
func DeleteHostLatencyConfig(host string) (*HostConfig, error)
func GetHostConfig ¶
func GetHostConfig(host string) (*HostConfig, error)
func UpdateHostErrorsConfig ¶
func UpdateHostErrorsConfig(host string, errorsConfig map[string]ErrorConfig) (*HostConfig, error)
func UpdateHostLatencyConfig ¶
func UpdateHostLatencyConfig(host string, latencyConfig *LatencyConfig) (*HostConfig, error)
func UpdateHostUrisConfig ¶
func UpdateHostUrisConfig(host string, urisConfig map[string]UriConfig) (*HostConfig, error)
func (HostConfig) Validate ¶
func (h HostConfig) Validate() error
type HostsConfig ¶
type HostsConfig struct {
Hosts map[string]HostConfig `json:"hosts"`
}
func GetHostsConfig ¶
func GetHostsConfig() (*HostsConfig, 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) Validate ¶
func (h HostsConfig) Validate() error
type LatencyConfig ¶
type MocksDirectoryConfig ¶
type MocksDirectoryConfig struct {
Path string
}
func GetMockDirectoryConfig ¶
func GetMockDirectoryConfig() (*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.