config

package
v0.0.0-...-202a999 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2020 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CacheConfig

type CacheConfig struct {
	Path string `yaml:"path"`
}

CacheConfig represents a cache configuration instance.

type Config

type Config struct {
	DataDir  string          `yaml:"data_dir"`
	Logger   *LoggerConfig   `yaml:"logger"`
	HTTP     *HTTPConfig     `yaml:"http"`
	Storage  *maputil.Map    `yaml:"storage"`
	Cache    *CacheConfig    `yaml:"cache"`
	Defaults *DefaultsConfig `yaml:"defaults"`
}

Config represents a configuration instance.

func New

func New(path string) (*Config, error)

New creates a new configuration instance, initializing its content based on a provided configuration file.

type DefaultsConfig

type DefaultsConfig struct {
	TimeRange string `json:"time_range" yaml:"time_range"`
}

DefaultsConfig represents a service defaults configuration instance.

type HTTPConfig

type HTTPConfig struct {
	Listen          string `yaml:"listen"`
	GracefulTimeout int    `yaml:"graceful_timeout"`
	BasePath        string `yaml:"base_path"`
	ReadOnly        bool   `yaml:"read_only"`
	EnableUI        bool   `yaml:"enable_ui"`
	ExposeVersion   bool   `yaml:"expose_version"`

	SocketMode  string
	SocketUser  string
	SocketGroup string
}

HTTPConfig represents a HTTP configuration instance.

type LoggerConfig

type LoggerConfig struct {
	File   *LoggerFileConfig   `yaml:"file"`
	Syslog *LoggerSyslogConfig `yaml:"syslog"`
}

LoggerConfig represents a logger configuration instance.

type LoggerFileConfig

type LoggerFileConfig struct {
	Level string `yaml:"level"`
	Path  string `yaml:"path"`
}

LoggerFileConfig represents a file logger configuration instance.

type LoggerSyslogConfig

type LoggerSyslogConfig struct {
	Level     string `yaml:"level"`
	Facility  string `yaml:"facility"`
	Tag       string `yaml:"tag"`
	Address   string `yaml:"address"`
	Transport string `yaml:"transport"`
}

LoggerSyslogConfig represents a Syslog logger configuration instance.

Jump to

Keyboard shortcuts

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