wrapper

package
v0.11.1 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2017 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteSimulations added in v0.11.1

func DeleteSimulations(target Target) error

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

func DownloadFile

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

func ExportSimulation added in v0.11.1

func ExportSimulation(target Target) ([]byte, error)

func FlushCache added in v0.11.1

func FlushCache(target Target) error

func GetDestination added in v0.11.1

func GetDestination(target Target) (string, error)

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

func GetMode(target Target) (string, error)

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 ImportSimulation(target Target, simulationData string) error

func IsLocal added in v0.11.1

func IsLocal(url string) bool

func Login added in v0.11.1

func Login(target Target, username, password string) (string, error)

func ReadFile

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

func SetConfigurationDefaults

func SetConfigurationDefaults()

func SetConfigurationPaths

func SetConfigurationPaths()

func SetDestination added in v0.11.1

func SetDestination(target Target, destination string) (string, error)

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

func SetModeWithArguments(target Target, modeView v2.ModeView) (string, error)

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

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 {
	DefaultTarget string            `yaml:"default"`
	Targets       map[string]Target `yaml:"targets"`
}

func GetConfig

func GetConfig() *Config

func (*Config) DeleteTarget added in v0.11.1

func (this *Config) DeleteTarget(targetToDelete Target)

func (*Config) GetFilepath

func (c *Config) GetFilepath() string

func (*Config) GetTarget added in v0.11.1

func (this *Config) GetTarget(targetName string) *Target

func (*Config) NewTarget added in v0.11.1

func (this *Config) NewTarget(target Target)

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 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)

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"`
}

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"`

	AuthEnabled bool
	Username    string
	Password    string
}

func NewDefaultTarget added in v0.11.1

func NewDefaultTarget() *Target

func NewTarget added in v0.11.1

func NewTarget(name, host string, adminPort, proxyPort int) *Target

func (Target) BuildFlags added in v0.11.1

func (this Target) BuildFlags() Flags

Jump to

Keyboard shortcuts

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