config

package
v0.0.31 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2021 License: Apache-2.0 Imports: 11 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        `json:"file_store_root"`
	DefaultDomain string        `json:"default_domain"`
	Logging       logger.Config `json:"logging"`
	CA            []string      `json:"ca"`
	Repl          struct {
		HistoryFile string `json:"history_file"`
	} `json:"repl"`

	Servers map[string]ServerCredentials `json:"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 `json:"type"`
	Username string `json:"username"`
	Password string `json:"password"`
}

Jump to

Keyboard shortcuts

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