config

package
v0.19.2 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EnvironmentOptionAuthBind = NewStringEnvironmentOption("auth.bind", "0.0.0.0:0")
View Source
var EnvironmentOptionAuthOpenCommand = NewStringSliceEnvironmentOption("auth.open_command", defaultAuthOpenCommand)

Functions

This section is empty.

Types

type DefaultManager

type DefaultManager struct {
	// contains filtered or unexported fields
}

func NewDefaultManager

func NewDefaultManager(storage storage.Storage, path string) DefaultManager

func (DefaultManager) GetEnvironment

func (m DefaultManager) GetEnvironment(name string) (EnvironmentState, error)

func (DefaultManager) GetEnvironments

func (m DefaultManager) GetEnvironments() (EnvironmentsState, error)

func (DefaultManager) GetSource

func (m DefaultManager) GetSource() string

func (DefaultManager) SetEnvironment

func (m DefaultManager) SetEnvironment(env EnvironmentState) error

func (DefaultManager) UnsetEnvironment added in v0.9.0

func (m DefaultManager) UnsetEnvironment(name string) error

type EnvironmentAuthState

type EnvironmentAuthState struct {
	Name    string      `yaml:"name,omitempty"`
	Type    string      `yaml:"type"`
	Options interface{} `yaml:"options,omitempty"`
}

func (EnvironmentAuthState) UnmarshalOptions

func (ea EnvironmentAuthState) UnmarshalOptions(typed interface{}) error

type EnvironmentOption added in v0.4.0

type EnvironmentOption interface {
	Key() string
	SetValue(interface{}) error
	GetDefaultValue() interface{}
}

type EnvironmentState

type EnvironmentState struct {
	URL           string                 `yaml:"url"`
	CACertificate string                 `yaml:"ca_certificate,omitempty"`
	Alias         string                 `yaml:"alias,omitempty"`
	Auth          *EnvironmentAuthState  `yaml:"auth,omitempty"`
	Options       map[string]interface{} `yaml:"options,omitempty"`
}

func (EnvironmentState) GetCACertificate

func (e EnvironmentState) GetCACertificate() (*x509.Certificate, error)

func (EnvironmentState) GetOption added in v0.4.0

func (e EnvironmentState) GetOption(option EnvironmentOption) error

func (*EnvironmentState) SetOption added in v0.4.0

func (e *EnvironmentState) SetOption(key string, val interface{})

type EnvironmentsState

type EnvironmentsState []EnvironmentState

type Manager

type Manager interface {
	GetSource() string
	GetEnvironments() (EnvironmentsState, error)
	GetEnvironment(string) (EnvironmentState, error)
	SetEnvironment(EnvironmentState) error
	UnsetEnvironment(string) error
}

type State

type State struct {
	Environments EnvironmentsState `yaml:"environments,omitempty"`
}

type StringEnvironmentOption added in v0.12.0

type StringEnvironmentOption struct {
	// contains filtered or unexported fields
}

func NewStringEnvironmentOption added in v0.12.0

func NewStringEnvironmentOption(key string, defaultValue string) StringEnvironmentOption

func (*StringEnvironmentOption) GetDefaultValue added in v0.17.0

func (eo *StringEnvironmentOption) GetDefaultValue() interface{}

func (*StringEnvironmentOption) GetValue added in v0.12.0

func (eo *StringEnvironmentOption) GetValue() string

func (*StringEnvironmentOption) Key added in v0.12.0

func (eo *StringEnvironmentOption) Key() string

func (*StringEnvironmentOption) SetValue added in v0.12.0

func (eo *StringEnvironmentOption) SetValue(value interface{}) error

type StringSliceEnvironmentOption added in v0.4.0

type StringSliceEnvironmentOption struct {
	// contains filtered or unexported fields
}

func NewStringSliceEnvironmentOption added in v0.4.0

func NewStringSliceEnvironmentOption(key string, defaultValue []string) StringSliceEnvironmentOption

func (*StringSliceEnvironmentOption) GetDefaultValue added in v0.17.0

func (eo *StringSliceEnvironmentOption) GetDefaultValue() interface{}

func (*StringSliceEnvironmentOption) GetValue added in v0.4.0

func (eo *StringSliceEnvironmentOption) GetValue() []string

func (*StringSliceEnvironmentOption) Key added in v0.4.0

func (*StringSliceEnvironmentOption) SetValue added in v0.4.0

func (eo *StringSliceEnvironmentOption) SetValue(value interface{}) error

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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