config

package
v0.0.0-...-c8a5df3 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2018 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Homedir

func Homedir() (string, error)

Homedir returns the home directory of the OS' logged-in user.

func InitConfig

func InitConfig(r io.Reader) (tapr.Config, error)

InitConfig initializes a client config from an io.Reader.

func New

func New() tapr.Config

New returns a config with all fields set as defaults.

func Register

func Register(name string, fn StoreConfigurator) error

Register registers the StoreConfigurator with the config system.

func SetTarget

func SetTarget(cfg tapr.Config, target string) tapr.Config

SetTarget returns a config derived from the given config with the target store set.

Types

type ServerConfig

type ServerConfig struct {
	Stores map[string]StoreConfig `yaml:"stores"`
}

ServerConfig is the main server configuration.

func InitServerConfig

func InitServerConfig(r io.Reader) (*ServerConfig, error)

InitServerConfig initializes a server configuration from an io.Reader.

type StoreConfig

type StoreConfig struct {
	Backend string

	// Embedded holds an embedded implementation-specific configuration.
	Embedded interface{}
}

StoreConfig is a partial store configuration.

func (*StoreConfig) UnmarshalYAML

func (c *StoreConfig) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements yaml.Unmarshaler.

type StoreConfigurator

type StoreConfigurator func(cfg *StoreConfig, unmarshal func(interface{}) error) error

A StoreConfigurator is a function that given a raw config YAML value produces a implementation specific store config.

Jump to

Keyboard shortcuts

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