server

package
v0.5.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2016 License: MPL-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

BuiltinListeners is the list of built-in listener types.

Functions

func NewListener

func NewListener(t string, config map[string]string) (net.Listener, map[string]string, error)

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

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 (*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) (net.Listener, map[string]string, error)

ListenerFactory is the factory function to create a listener.

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