config

package
v0.0.0-dev Latest Latest
Warning

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

Go to latest
Published: May 9, 2022 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetBool

func GetBool(key string, defaultValue bool) bool

func GetString

func GetString(key, defaultValue string) string

Types

type Config

type Config struct {
	ListenAddr string   `yaml:"listen_addr"`
	ServerUrl  string   `yaml:"server_url"`
	Tls        Tls      `yaml:"tls"`
	Metrics    Metrics  `yaml:"metrics"`
	Logging    Logging  `yaml:"logging"`
	Keys       Keys     `yaml:"keys"`
	Database   Database `yaml:"database"`
}

func LoadConfig

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

func (*Config) CreateUrl

func (c *Config) CreateUrl(format string, a ...interface{}) string

func (*Config) ReadServerKeys

func (c *Config) ReadServerKeys() (*ServerKeys, error)

type Database

type Database struct {
	Url string `yaml:"url"`
}

type Keys

type Keys struct {
	SystemAdminKey   string `yaml:"system_admin_key"`
	ControlKey       string `yaml:"control_key"`
	LegacyControlKey string `yaml:"legacy_control_key"`
}

type Logging

type Logging struct {
	Level  string `yaml:"level"`
	Format string `yaml:"format"`
	File   string `yaml:"file"`
}

type Metrics

type Metrics struct {
	ListenAddr string `yaml:"listen_addr"`
}

type ServerKeys

type ServerKeys struct {
	SystemAdminKey   key.MachinePrivate
	ControlKey       key.MachinePrivate
	LegacyControlKey key.MachinePrivate
}

type Tls

type Tls struct {
	Disable  bool   `yaml:"disable"`
	CertFile string `yaml:"cert_file"`
	KeyFile  string `yaml:"key_file"`
}

Jump to

Keyboard shortcuts

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