config

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2019 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConfigFile string = "configs/state.yml"
)

Metaconfigs ...

Variables

This section is empty.

Functions

This section is empty.

Types

type BadgerConfig

type BadgerConfig struct {
	Directory      string
	ValueDirectory string
}

BadgerConfig ...

type ClientConfig

type ClientConfig struct {
	Logging *logger.ZyLogOptions
}

ClientConfig ...

type CockroachConfig

type CockroachConfig struct {
	Host string
	Port int
}

CockroachConfig ...

type Config

type Config struct {
	Client  *ClientConfig
	DB      *DBConfig
	GRPCD   *GRPCDConfig
	Logging *logger.ZyLogOptions
}

Config ...

func NewConfig

func NewConfig() *Config

NewConfig is a constructor that creates the full coniguration data structure for use by our application(s) and client(s) as an in-memory copy of the config data (saving from having to make repeated and somewhat expensive calls to the viper library).

Note that Viper does provide both the AllSettings() and Unmarshall() functions, but these require that you have a struct defined that will be used to dump the Viper config data into. We've already got that set up, so there's no real benefit to switching.

Furthermore, in our case, we're utilizing structs from other libraries to be used when setting those up (see how we initialize the logging component in ./components/logging.go, Setup).

func (*Config) BadgerConnectionString

func (c *Config) BadgerConnectionString() string

BadgerConnectionString ...

func (*Config) CockroachConnectionString

func (c *Config) CockroachConnectionString() string

CockroachConnectionString ...

func (*Config) GRPCConnectionString

func (c *Config) GRPCConnectionString() string

GRPCConnectionString ...

type DBConfig

type DBConfig struct {
	Type      string
	Badger    *BadgerConfig
	Cockroach *CockroachConfig
}

DBConfig ...

type GRPCDConfig

type GRPCDConfig struct {
	Host string
	Port int
}

GRPCDConfig ...

Jump to

Keyboard shortcuts

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