config

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2019 License: Apache-2.0 Imports: 5 Imported by: 2

Documentation

Index

Constants

View Source
const (
	AppName         string = "raster"
	ConfigDir       string = "configs"
	ConfigFile      string = "app"
	ConfigType      string = "yaml"
	ConfigReadError string = "Fatal error config file"
)

Configuration related constants

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientConfig added in v0.1.0

type ClientConfig struct {
	Logging *logger.ZyLogOptions
}

ClientConfig ...

type Config

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

Config ...

func New

func New() *Config

New 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 ...

func (*Config) RedisConnectionString

func (c *Config) RedisConnectionString() string

RedisConnectionString ...

func (*Config) RedixConnectionString

func (c *Config) RedixConnectionString() string

RedixConnectionString ...

type DBConfig

type DBConfig struct {
	Type  string
	Redis *RedisConfig
	Redix *RedixConfig
}

DBConfig ...

type GRPCDConfig

type GRPCDConfig struct {
	Host string
	Port int
}

GRPCDConfig ...

type RedisConfig

type RedisConfig struct {
	Name     string
	Host     string
	Port     int
	Password string
	DBIndex  int
}

RedisConfig ...

type RedixConfig

type RedixConfig struct {
	Name string
	Host string
	Port int
}

RedixConfig ...

Jump to

Keyboard shortcuts

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