server

package
v0.6.0-rebuild Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2016 License: MPL-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BuiltinListeners = map[string]ListenerFactory{
	"tcp":   tcpListenerFactory,
	"atlas": atlasListenerFactory,
}

BuiltinListeners is the list of built-in listener types.

Functions

This section is empty.

Types

type Backend

type Backend struct {
	Type          string
	AdvertiseAddr string
	Config        map[string]string
}

Backend is the backend configuration for the server.

func (*Backend) GoString

func (b *Backend) GoString() string

type Config

type Config struct {
	Listeners []*Listener `hcl:"-"`
	Backend   *Backend    `hcl:"-"`
	HABackend *Backend    `hcl:"-"`

	DisableCache bool `hcl:"disable_cache"`
	DisableMlock bool `hcl:"disable_mlock"`

	Telemetry *Telemetry `hcl:"telemetry"`

	MaxLeaseTTL        time.Duration `hcl:"-"`
	MaxLeaseTTLRaw     string        `hcl:"max_lease_ttl"`
	DefaultLeaseTTL    time.Duration `hcl:"-"`
	DefaultLeaseTTLRaw string        `hcl:"default_lease_ttl"`
}

Config is the configuration for the vault server.

func DevConfig

func DevConfig() *Config

DevConfig is a Config that is used for dev mode of Vault.

func LoadConfig

func LoadConfig(path string) (*Config, error)

LoadConfig loads the configuration at the given path, regardless if its a file or directory.

func LoadConfigDir

func LoadConfigDir(dir string) (*Config, error)

LoadConfigDir loads all the configurations in the given directory in alphabetical order.

func LoadConfigFile

func LoadConfigFile(path string) (*Config, error)

LoadConfigFile loads the configuration from the given file.

func ParseConfig added in v0.5.2

func ParseConfig(d string) (*Config, error)

func (*Config) Merge

func (c *Config) Merge(c2 *Config) *Config

Merge merges two configurations.

type Listener

type Listener struct {
	Type   string
	Config map[string]string
}

Listener is the listener configuration for the server.

func (*Listener) GoString

func (l *Listener) GoString() string

type ListenerFactory

type ListenerFactory func(map[string]string, io.Writer) (net.Listener, map[string]string, ReloadFunc, error)

ListenerFactory is the factory function to create a listener.

type ReloadFunc added in v0.5.2

type ReloadFunc func(map[string]string) error

ReloadFunc are functions that are called when a reload is requested.

func NewListener

func NewListener(t string, config map[string]string, logger io.Writer) (net.Listener, map[string]string, ReloadFunc, error)

NewListener creates a new listener of the given type with the given configuration. The type is looked up in the BuiltinListeners map.

type SCADAListener added in v0.6.0

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

func (*SCADAListener) Accept added in v0.6.0

func (s *SCADAListener) Accept() (net.Conn, error)

func (*SCADAListener) Addr added in v0.6.0

func (s *SCADAListener) Addr() net.Addr

func (*SCADAListener) Close added in v0.6.0

func (s *SCADAListener) Close() error

type Telemetry added in v0.3.0

type Telemetry struct {
	StatsiteAddr string `hcl:"statsite_address"`
	StatsdAddr   string `hcl:"statsd_address"`

	DisableHostname bool `hcl:"disable_hostname"`
}

Telemetry is the telemetry configuration for the server

func (*Telemetry) GoString added in v0.3.0

func (s *Telemetry) GoString() string

Jump to

Keyboard shortcuts

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