Documentation
¶
Index ¶
- func BuildURL(target Target, endpoint string) string
- func DeleteSimulations(target Target) error
- func DownloadFile(filePath string) ([]byte, error)
- func ExportSimulation(target Target) ([]byte, error)
- func FlushCache(target Target) error
- func GetDestination(target Target) (string, error)
- func GetMiddleware(target Target) (v2.MiddlewareView, error)
- func GetMode(target Target) (string, error)
- func ImportSimulation(target Target, simulationData string) error
- func IsLocal(url string) bool
- func Login(target Target, username, password string) (string, error)
- func ReadFile(filePath string) ([]byte, error)
- func SetConfigurationDefaults()
- func SetConfigurationPaths()
- func SetDestination(target Target, destination string) (string, error)
- func SetMiddleware(target Target, binary, script, remote string) (v2.MiddlewareView, error)
- func SetModeWithArguments(target Target, modeView v2.ModeView) (string, error)
- func Start(target *Target, hoverflyDirectory HoverflyDirectory) error
- func Stop(target *Target, hoverflyDirectory HoverflyDirectory) error
- func WriteFile(filePath string, data []byte) error
- type APIDelaySchema
- type APIStateSchema
- type Config
- type ErrorSchema
- type Flags
- type HoverflyAuthSchema
- type HoverflyAuthTokenSchema
- type HoverflyDirectory
- type LogFile
- type MiddlewareSchema
- type ResponseDelaySchema
- type Target
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteSimulations ¶ added in v0.11.1
Wipe will call the records endpoint in Hoverfly with a DELETE request, triggering Hoverfly to wipe the database
func DownloadFile ¶
func ExportSimulation ¶ added in v0.11.1
func FlushCache ¶ added in v0.11.1
func GetDestination ¶ added in v0.11.1
GetDestination will go the destination endpoint in Hoverfly, parse the JSON response and return the destination of Hoverfly
func GetMiddleware ¶ added in v0.11.1
func GetMiddleware(target Target) (v2.MiddlewareView, error)
GetMiddle will go the middleware endpoint in Hoverfly, parse the JSON response and return the middleware of Hoverfly
func GetMode ¶ added in v0.11.1
GetMode will go the state endpoint in Hoverfly, parse the JSON response and return the mode of Hoverfly
func ImportSimulation ¶ added in v0.11.1
func SetConfigurationDefaults ¶
func SetConfigurationDefaults()
func SetConfigurationPaths ¶
func SetConfigurationPaths()
func SetDestination ¶ added in v0.11.1
SetDestination will go the destination endpoint in Hoverfly, sending JSON that will set the destination of Hoverfly
func SetMiddleware ¶ added in v0.11.1
func SetMiddleware(target Target, binary, script, remote string) (v2.MiddlewareView, error)
func SetModeWithArguments ¶ added in v0.11.1
Set will go the state endpoint in Hoverfly, sending JSON that will set the mode of Hoverfly
func Start ¶ added in v0.11.1
func Start(target *Target, hoverflyDirectory HoverflyDirectory) error
func Stop ¶ added in v0.11.1
func Stop(target *Target, hoverflyDirectory HoverflyDirectory) error
Types ¶
type APIDelaySchema ¶
type APIDelaySchema struct {
Data []ResponseDelaySchema `json:"data"`
}
type APIStateSchema ¶
type Config ¶
type Config struct {
DefaultTarget string `yaml:"default"`
Targets map[string]Target `yaml:"targets"`
}
func (*Config) DeleteTarget ¶ added in v0.11.1
func (*Config) GetFilepath ¶
func (*Config) WriteToFile ¶
func (c *Config) WriteToFile(hoverflyDirectory HoverflyDirectory) error
type ErrorSchema ¶
type ErrorSchema struct {
ErrorMessage string `json:"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)
type LogFile ¶
func NewLogFile ¶
func NewLogFile(directory HoverflyDirectory, adminPort, proxyPort string) LogFile
type MiddlewareSchema ¶
type MiddlewareSchema struct {
Middleware string `json:"middleware"`
}
type ResponseDelaySchema ¶
type Target ¶ added in v0.11.1
type Target struct {
Name string
Host string `yaml:"host,omitempty"`
AdminPort int `yaml:"admin.port,omitempty"`
ProxyPort int `yaml:"proxy.port,omitempty"`
AuthToken string `yaml:"auth.token,omitempty"`
Pid int `yaml:"pid,omitempty"`
Webserver bool `yaml:",omitempty"`
CachePath string `yaml:",omitempty"`
DisableCache bool `yaml:",omitempty"`
CertificatePath string `yaml:",omitempty"`
KeyPath string `yaml:",omitempty"`
DisableTls bool `yaml:",omitempty"`
UpstreamProxyUrl string `yaml:",omitempty"`
HttpsOnly bool `yaml:",omitempty"`
AuthEnabled bool
Username string
Password string
}
func NewDefaultTarget ¶ added in v0.11.1
func NewDefaultTarget() *Target