config

package
v0.0.23 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewLoggerConfig

func NewLoggerConfig(configPath Path, overrides Overrider) (*logger.Config, error)

NewLoggerConfig creates a new LoggerConfig

Types

type Config

type Config struct {
	FileStoreRoot string        `mapstructure:"file_store_root"`
	DefaultDomain string        `mapstructure:"default_domain"`
	Logging       logger.Config `mapstructure:"logging"`
	CA            []string      `mapstructure:"ca"`

	Servers map[string]ServerCredentials `mapstructure:"servers"`
}

Config holds the configuration for the app.

func NewConfig

func NewConfig(configPath Path, log *zerolog.Logger, overrides Overrider, certsGenerator *certs.Generator) (*Config, error)

NewConfig creates the configuration by reading env & files

func (*Config) LoadCreds

func (c *Config) LoadCreds() error

func (*Config) SaveCreds

func (c *Config) SaveCreds() error

type Overrider

type Overrider func(*Config)

Overrider is a func that mutates configuration

type Path

type Path string

Path is a string that points to a config file

type ServerCredentials

type ServerCredentials struct {
	Type     string `mapstructure:"type"`
	Username string `mapstructure:"username"`
	Password string `mapstructure:"password"`
}

Jump to

Keyboard shortcuts

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