wrapper

package
v0.10.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 24, 2017 License: Apache-2.0 Imports: 21 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DownloadFile

func DownloadFile(filePath string) ([]byte, error)

func ReadFile

func ReadFile(filePath string) ([]byte, error)

func SetConfigurationDefaults

func SetConfigurationDefaults()

func SetConfigurationPaths

func SetConfigurationPaths()

func WriteFile

func WriteFile(filePath string, data []byte) error

Types

type APIDelaySchema

type APIDelaySchema struct {
	Data []ResponseDelaySchema `json:"data"`
}

type APIStateSchema

type APIStateSchema struct {
	Mode        string `json:"mode"`
	Destination string `json:"destination"`
}

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 GetConfig

func GetConfig() *Config

func (Config) BuildFlags

func (this Config) BuildFlags() Flags

func (*Config) DisableTls

func (this *Config) DisableTls(disableTls bool) *Config

func (*Config) GetFilepath

func (c *Config) GetFilepath() string

func (*Config) SetAdminPort

func (this *Config) SetAdminPort(adminPort string) *Config

func (*Config) SetCertificate

func (this *Config) SetCertificate(certificate string) *Config

func (*Config) SetDbType

func (this *Config) SetDbType(dbType string) *Config

func (*Config) SetHost

func (this *Config) SetHost(host string) *Config

func (*Config) SetKey

func (this *Config) SetKey(key string) *Config

func (*Config) SetPassword

func (this *Config) SetPassword(password string) *Config

func (*Config) SetProxyPort

func (this *Config) SetProxyPort(proxyPort string) *Config

func (*Config) SetUpstreamProxy

func (this *Config) SetUpstreamProxy(upstreamProxy string) *Config

func (*Config) SetUsername

func (this *Config) SetUsername(username string) *Config

func (*Config) SetWebserver

func (this *Config) SetWebserver(hoverflyType string) *Config

func (*Config) WriteToFile

func (c *Config) WriteToFile(hoverflyDirectory HoverflyDirectory) error

type ErrorSchema

type ErrorSchema struct {
	ErrorMessage string `json:"error"`
}

type Flags

type Flags []string

type Hoverfly

type Hoverfly struct {
	Host      string
	AdminPort string
	ProxyPort string
	Username  string
	Password  string
	// contains filtered or unexported fields
}

func NewHoverfly

func NewHoverfly(config Config) Hoverfly

func (*Hoverfly) DeleteSimulations

func (h *Hoverfly) DeleteSimulations() error

Wipe will call the records endpoint in Hoverfly with a DELETE request, triggering Hoverfly to wipe the database

func (*Hoverfly) ExportSimulation

func (h *Hoverfly) ExportSimulation() ([]byte, error)

func (*Hoverfly) GetDestination

func (h *Hoverfly) GetDestination() (string, error)

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

func (h *Hoverfly) GetMode() (string, error)

GetMode will go the state endpoint in Hoverfly, parse the JSON response and return the mode of Hoverfly

func (*Hoverfly) ImportSimulation

func (h *Hoverfly) ImportSimulation(simulationData string, v1 bool) error

func (*Hoverfly) SetDestination

func (h *Hoverfly) SetDestination(destination string) (string, error)

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

func (h *Hoverfly) SetMode(mode string) (string, error)

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 HoverflyAuthSchema struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

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

func (*HoverflyDirectory) GetPid

func (h *HoverflyDirectory) GetPid(adminPort, proxyPort string) (int, error)

func (*HoverflyDirectory) WritePid

func (h *HoverflyDirectory) WritePid(adminPort, proxyPort string, pid int) error

type LogFile

type LogFile struct {
	Path string
	Name string
}

func NewLogFile

func NewLogFile(directory HoverflyDirectory, adminPort, proxyPort string) LogFile

func (*LogFile) Print

func (l *LogFile) Print() error

func (*LogFile) Tail

func (l *LogFile) Tail() error

type MiddlewareSchema

type MiddlewareSchema struct {
	Middleware string `json:"middleware"`
}

type ResponseDelaySchema

type ResponseDelaySchema struct {
	UrlPattern string `json:"urlpattern"`
	Delay      int    `json:"delay"`
	HttpMethod string `json:"httpmethod"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL