config

package
v1.87.0 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2020 License: MIT Imports: 12 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 {
	ListenAddr      string            `toml:"listen_addr"`
	SocketPath      string            `toml:"socket_path"`
	VirtualStorages []*VirtualStorage `toml:"virtual_storage"`
	//TODO: Remove VirtualStorageName and Nodes once omnibus and gdk are updated with support for
	// VirtualStorages
	VirtualStorageName   string            `toml:"virtual_storage_name"`
	Nodes                []*models.Node    `toml:"node"`
	Logging              log.Config        `toml:"logging"`
	Sentry               sentry.Config     `toml:"sentry"`
	PrometheusListenAddr string            `toml:"prometheus_listen_addr"`
	Prometheus           prometheus.Config `toml:"prometheus"`
	Auth                 auth.Config       `toml:"auth"`
	DB                   `toml:"database"`
	FailoverEnabled      bool `toml:"failover_enabled"`
}

Config is a container for everything found in the TOML config file

func FromFile

func FromFile(filePath string) (Config, error)

FromFile loads the config for the passed file path

func (Config) ConfigureLogger

func (c Config) ConfigureLogger() *logrus.Entry

ConfigureLogger applies the settings from the configuration file to the logger, setting the log level and format.

func (Config) Validate

func (c Config) Validate() error

Validate establishes if the config is valid

type DB added in v1.76.0

type DB struct {
	Host        string `toml:"host"`
	Port        int    `toml:"port"`
	User        string `toml:"user"`
	Password    string `toml:"password"`
	DBName      string `toml:"dbname"`
	SSLMode     string `toml:"sslmode"`
	SSLCert     string `toml:"sslcert"`
	SSLKey      string `toml:"sslkey"`
	SSLRootCert string `toml:"sslrootcert"`
}

DB holds Postgres client configuration data.

func (DB) ToPQString added in v1.76.0

func (db DB) ToPQString() string

ToPQString returns a connection string that can be passed to github.com/lib/pq.

type VirtualStorage added in v1.75.0

type VirtualStorage struct {
	Name  string         `toml:"name"`
	Nodes []*models.Node `toml:"node"`
}

VirtualStorage represents a set of nodes for a storage

Jump to

Keyboard shortcuts

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