config

package
v0.0.0-...-f770173 Latest Latest
Warning

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

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

Documentation

Index

Constants

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

Metaconfigs ...

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientConfig

type ClientConfig struct {
	Logging *logger.ZyLogOptions
}

ClientConfig ...

type Config

type Config struct {
	Client          *ClientConfig
	MessagingServer *MessagingServerConfig
	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) GRPCConnectionString

func (c *Config) GRPCConnectionString() string

GRPCConnectionString ...

type GRPCDConfig

type GRPCDConfig struct {
	Host string
	Port int
}

GRPCDConfig ...

type MessagingServerConfig

type MessagingServerConfig struct {
	Host string
	Port int
}

MessagingServerConfig ...

Jump to

Keyboard shortcuts

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