Documentation
¶
Index ¶
- func DownloadFile(filePath string) ([]byte, error)
- func ReadFile(filePath string) ([]byte, error)
- func SetConfigurationDefaults()
- func SetConfigurationPaths()
- func WriteFile(filePath string, data []byte) error
- type APIDelaySchema
- type APIStateSchema
- type Config
- func (this Config) BuildFlags() Flags
- func (this *Config) DisableTls(disableTls bool) *Config
- func (c *Config) GetFilepath() string
- func (this *Config) SetAdminPort(adminPort string) *Config
- func (this *Config) SetCertificate(certificate string) *Config
- func (this *Config) SetDbType(dbType string) *Config
- func (this *Config) SetHost(host string) *Config
- func (this *Config) SetKey(key string) *Config
- func (this *Config) SetPassword(password string) *Config
- func (this *Config) SetProxyPort(proxyPort string) *Config
- func (this *Config) SetUpstreamProxy(upstreamProxy string) *Config
- func (this *Config) SetUsername(username string) *Config
- func (this *Config) SetWebserver(hoverflyType string) *Config
- func (c *Config) WriteToFile(hoverflyDirectory HoverflyDirectory) error
- type ErrorSchema
- type Flags
- type Hoverfly
- func (h *Hoverfly) DeleteSimulations() error
- func (h *Hoverfly) ExportSimulation() ([]byte, error)
- func (h *Hoverfly) GetDestination() (string, error)
- func (h *Hoverfly) GetMiddleware() (v2.MiddlewareView, error)
- func (h *Hoverfly) GetMode() (string, error)
- func (h *Hoverfly) ImportSimulation(simulationData string, v1 bool) error
- func (h *Hoverfly) SetDestination(destination string) (string, error)
- func (h *Hoverfly) SetMiddleware(binary, script, remote string) (v2.MiddlewareView, error)
- func (h *Hoverfly) SetMode(mode string) (string, error)
- func (h *Hoverfly) Start(hoverflyDirectory HoverflyDirectory) error
- func (h *Hoverfly) Stop(hoverflyDirectory HoverflyDirectory) error
- type HoverflyAuthSchema
- type HoverflyAuthTokenSchema
- type HoverflyDirectory
- type LogFile
- type MiddlewareSchema
- type ResponseDelaySchema
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DownloadFile ¶
func SetConfigurationDefaults ¶
func SetConfigurationDefaults()
func SetConfigurationPaths ¶
func SetConfigurationPaths()
Types ¶
type APIDelaySchema ¶
type APIDelaySchema struct {
Data []ResponseDelaySchema `json:"data"`
}
type APIStateSchema ¶
type Config ¶
type Config struct { HoverflyHost string `yaml:"hoverfly.host"` HoverflyAdminPort string `yaml:"hoverfly.admin.port"` HoverflyProxyPort string `yaml:"hoverfly.proxy.port"` HoverflyDbType string `yaml:"hoverfly.db.type"` HoverflyUsername string `yaml:"hoverfly.username"` HoverflyPassword string `yaml:"hoverfly.password"` HoverflyWebserver bool `yaml:"hoverfly.webserver"` HoverflyCertificate string `yaml:"hoverfly.tls.certificate"` HoverflyKey string `yaml:"hoverfly.tls.key"` HoverflyDisableTls bool `yaml:"hoverfly.tls.disable"` HoverflyUpstreamProxy string `yaml:"hoverfly.upstream.proxy"` }
func (Config) BuildFlags ¶
func (*Config) DisableTls ¶
func (*Config) GetFilepath ¶
func (*Config) SetAdminPort ¶
func (*Config) SetCertificate ¶
func (*Config) SetPassword ¶
func (*Config) SetProxyPort ¶
func (*Config) SetUpstreamProxy ¶
func (*Config) SetUsername ¶
func (*Config) SetWebserver ¶
func (*Config) WriteToFile ¶
func (c *Config) WriteToFile(hoverflyDirectory HoverflyDirectory) error
type ErrorSchema ¶
type ErrorSchema struct {
ErrorMessage string `json:"error"`
}
type Hoverfly ¶
type Hoverfly struct { Host string AdminPort string ProxyPort string Username string Password string // contains filtered or unexported fields }
func NewHoverfly ¶
func (*Hoverfly) DeleteSimulations ¶
Wipe will call the records endpoint in Hoverfly with a DELETE request, triggering Hoverfly to wipe the database
func (*Hoverfly) ExportSimulation ¶
func (*Hoverfly) GetDestination ¶
GetDestination will go the destination endpoint in Hoverfly, parse the JSON response and return the destination of Hoverfly
func (*Hoverfly) GetMiddleware ¶
func (h *Hoverfly) GetMiddleware() (v2.MiddlewareView, error)
GetMiddle will go the middleware endpoint in Hoverfly, parse the JSON response and return the middleware of Hoverfly
func (*Hoverfly) GetMode ¶
GetMode will go the state endpoint in Hoverfly, parse the JSON response and return the mode of Hoverfly
func (*Hoverfly) ImportSimulation ¶
func (*Hoverfly) SetDestination ¶
SetDestination will go the destination endpoint in Hoverfly, sending JSON that will set the destination of Hoverfly
func (*Hoverfly) SetMiddleware ¶
func (h *Hoverfly) SetMiddleware(binary, script, remote string) (v2.MiddlewareView, error)
func (*Hoverfly) SetMode ¶
Set will go the state endpoint in Hoverfly, sending JSON that will set the mode of Hoverfly
func (*Hoverfly) Start ¶
func (h *Hoverfly) Start(hoverflyDirectory HoverflyDirectory) error
func (*Hoverfly) Stop ¶
func (h *Hoverfly) Stop(hoverflyDirectory HoverflyDirectory) error
type HoverflyAuthSchema ¶
type HoverflyAuthTokenSchema ¶
type HoverflyAuthTokenSchema struct {
Token string `json:"token"`
}
type HoverflyDirectory ¶
type HoverflyDirectory struct {
Path string
}
func NewHoverflyDirectory ¶
func NewHoverflyDirectory(config Config) (HoverflyDirectory, error)
func (*HoverflyDirectory) DeletePid ¶
func (h *HoverflyDirectory) DeletePid(adminPort, proxyPort string) error
type LogFile ¶
func NewLogFile ¶
func NewLogFile(directory HoverflyDirectory, adminPort, proxyPort string) LogFile
type MiddlewareSchema ¶
type MiddlewareSchema struct {
Middleware string `json:"middleware"`
}