config

package
v0.0.0-...-7a19a46 Latest Latest
Warning

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

Go to latest
Published: May 4, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Databases map[string]DatabaseConfig `yaml:"databases"`
}

Config is the Go representation of the yaml config file.

type DatabaseConfig

type DatabaseConfig struct {
	User     string `yaml:"user"`
	Password string `yaml:"pass"`
}

Credentials is the Go representation of the credentials section in the yaml config file.

type SafeConfig

type SafeConfig struct {
	sync.RWMutex
	C *Config
}

SafeConfig wraps Config for concurrency-safe operations.

func (*SafeConfig) DatabaseConfigForTarget

func (sc *SafeConfig) DatabaseConfigForTarget(target string) (DatabaseConfig, error)

CredentialsForTarget returns the Credentials for a given target, or the default. It is concurrency-safe.

func (*SafeConfig) ReloadConfig

func (sc *SafeConfig) ReloadConfig(configFile string) error

Jump to

Keyboard shortcuts

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