config

package
v0.0.0-...-a88ee92 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2020 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckConfig

func CheckConfig() error

CheckConfig helps to check if global application config is ready.

func InitFromFile

func InitFromFile(path string) error

InitFromFile reads config file and initializes global config.

Types

type AppConfig

type AppConfig struct {
	Log        LogConfig              `yaml:"log"`
	PublicAPI  PublicAPIServerConfig  `yaml:"public_api"`
	ServiceAPI ServiceAPIServerConfig `yaml:"service_api"`
	Cache      CacheConfig            `yaml:"cache"`
}

AppConfig contains all application parameters.

var Config *AppConfig

Config is a global container for all configuration options.

type CacheConfig

type CacheConfig struct {
	EvictionInterval int `yaml:"eviction_interval"`
}

CacheConfig contains cache related configuration.

type LogConfig

type LogConfig struct {
	File      string `yaml:"file"`
	UseStdout bool   `yaml:"use_stdout"`
	Debug     bool   `yaml:"debug"`
}

LogConfig contains logger configuration.

type PublicAPIServerConfig

type PublicAPIServerConfig struct {
	ServerAddress string `yaml:"server_address"`
	ServerPort    int    `yaml:"server_port"`
	ReadTimeout   int    `yaml:"read_timeout"`
	WriteTimeout  int    `yaml:"write_timeout"`
	IdleTimeout   int    `yaml:"idle_timeout"`
}

PublicAPIServerConfig contains configuration to provide public REST API.

type ServiceAPIServerConfig

type ServiceAPIServerConfig struct {
	ServerAddress string `yaml:"server_address"`
	ServerPort    int    `yaml:"server_port"`
	ReadTimeout   int    `yaml:"read_timeout"`
	WriteTimeout  int    `yaml:"write_timeout"`
	IdleTimeout   int    `yaml:"idle_timeout"`
}

ServiceAPIServerConfig contains configuration to provide service REST API.

Jump to

Keyboard shortcuts

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