config

package
v0.0.1-preview4 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 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 {
	HttpListenAddr    string   `yaml:"http_listen_addr,omitempty"`
	HttpsListenAddr   string   `yaml:"https_listen_addr,omitempty"`
	MetricsListenAddr string   `yaml:"metrics_listen_addr,omitempty"`
	ServerUrl         string   `yaml:"server_url,omitempty"`
	Tls               Tls      `yaml:"tls,omitempty"`
	Logging           Logging  `yaml:"logging,omitempty"`
	Keys              Keys     `yaml:"keys,omitempty"`
	Database          Database `yaml:"database,omitempty"`
}

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,omitempty"`
}

type Keys

type Keys struct {
	SystemAdminKey string `yaml:"system_admin_key,omitempty"`
	EncryptionKey  string `yaml:"encryption_key,omitempty"`
}

type Logging

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

type ServerKeys

type ServerKeys struct {
	SystemAdminKey key.ServerPrivate
}

type Tls

type Tls struct {
	Disable              bool   `yaml:"disable"`
	CertFile             string `yaml:"cert_file,omitempty"`
	KeyFile              string `yaml:"key_file,omitempty"`
	CertMagicDomain      string `yaml:"cert_magic_domain,omitempty"`
	CertMagicEmail       string `yaml:"cert_magic_email,omitempty"`
	CertMagicCA          string `yaml:"cert_magic_ca,omitempty"`
	CertMagicStoragePath string `yaml:"cert_magic_storage_path,omitempty"`
}

Jump to

Keyboard shortcuts

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