config

package
v0.0.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Redis     RedisConfig     `json:"redis_server"`
	WebServer WebServerConfig `json:"web_server"`
}

Config is a struct that holds all the configuration options for the application.

func New

func New() (*Config, error)

New creates a new configuration struct and returns to to the caller. The configuration file location is either defaultConfigPath const or METRIC_AUTH_CONFIG environment variable.

type RedisConfig

type RedisConfig struct {
	RedisHost          string   `json:"redis_host"`
	RedisPort          string   `json:"redis_port"`
	AvailableEndpoints []string `json:"endpoints"`
}

type WebServerConfig

type WebServerConfig struct {
	ListenAddress string `json:"listen_address"`
	Port          string `json:"listen_port"`
	UseTLS        bool   `json:"use_tls"`
	CertPath      string `json:"cert_path"`
	KeyPath       string `json:"key_path"`
}

WebServerConfig holds the configuration for the http web server

Jump to

Keyboard shortcuts

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