configuration

package
v0.17.6 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2018 License: Apache-2.0 Imports: 12 Imported by: 0

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 Config

type Config struct {
	DefaultTarget string            `yaml:"default"`
	Targets       map[string]Target `yaml:"targets"`
}

func GetConfig

func GetConfig() *Config

func (*Config) DeleteTarget

func (this *Config) DeleteTarget(targetToDelete Target)

func (*Config) GetFilepath

func (c *Config) GetFilepath() string

func (*Config) GetTarget

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

func (*Config) NewTarget

func (this *Config) NewTarget(target Target)

func (*Config) WriteToFile

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

type Flags

type Flags []string

type HoverflyDirectory

type HoverflyDirectory struct {
	Path string
}

func NewHoverflyDirectory

func NewHoverflyDirectory(config Config) (HoverflyDirectory, error)

type Target

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"`
	ListenOnHost string `yaml:",omitempty"`

	CertificatePath string `yaml:",omitempty"`
	KeyPath         string `yaml:",omitempty"`
	DisableTls      bool   `yaml:",omitempty"`

	UpstreamProxyUrl string `yaml:",omitempty"`
	PACFile          string `yaml:",omitempty"`
	HttpsOnly        bool   `yaml:",omitempty"`

	ClientAuthenticationDestination string
	ClientAuthenticationClientCert  string
	ClientAuthenticationClientKey   string
	ClientAuthenticationCACert      string

	AuthEnabled bool
	Username    string
	Password    string
}

func NewDefaultTarget

func NewDefaultTarget() *Target

func NewTarget

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

func (Target) BuildFlags

func (this Target) BuildFlags() Flags

Jump to

Keyboard shortcuts

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