Help us shape the future of Go! Take the 2026 Go Developer Survey

server

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2015 License: MPL-2.0 Imports: 11 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:"-"`

	DisableMlock bool   `hcl:"disable_mlock"`
	StatsiteAddr string `hcl:"statsite_addr"`
	StatsdAddr   string `hcl:"statsd_addr"`
}

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.

Jump to

Keyboard shortcuts

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