configuration

package
v0.7.8 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetConfigurationDirectory

func GetConfigurationDirectory() (string, error)

GetConfigurationDirectory returns the directory where all state is stored

func InitializeEnvironment

func InitializeEnvironment(options ...EnvironmentOption)

InitializeEnvironment initializes the environment with the specified options

func SaveConfiguration

func SaveConfiguration(toSave Configuration) error

SaveConfiguration saves a configuration to the file

Types

type Configuration

type Configuration struct {
	// BaseDirectories stores all the places where configuration files can be found
	BaseDirectories []string
}

Configuration stores general configuration for the proxy

func LoadConfiguration

func LoadConfiguration() (*Configuration, error)

LoadConfiguration loads the current user configuration

type Environment

type Environment struct {
	AdminPort       int
	CertificateFile string
	KeyFile         string
	ProxyPort       int
}

Environment stores information about the runtime

func GetEnvironment

func GetEnvironment() Environment

GetEnvironment returns the current runtime environment

type EnvironmentOption

type EnvironmentOption func(*Environment)

EnvironmentOption represents an option to be applied on the environment

func WithAdminPort

func WithAdminPort(port int) EnvironmentOption

WithAdminPort configuration option to setup an Admin server and UI port

func WithCertificateFile

func WithCertificateFile(pathToCertFile string) EnvironmentOption

WithCertificateFile configuration option to setup the certificate file to use for TLS

func WithKeyFile

func WithKeyFile(pathToKeyFile string) EnvironmentOption

WithKeyFile configuration option to setup the key file to use for TLS

func WithProxyPort

func WithProxyPort(port int) EnvironmentOption

WithProxyPort configuration option to setup the proxy port

Jump to

Keyboard shortcuts

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