config

package
v0.0.0-...-4da4744 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultLogLevel = "info"

Variables

This section is empty.

Functions

This section is empty.

Types

type Notifications

type Notifications struct {
	Service   *Service            `mapstructure:"service" toml:"service"`
	Postgres  *Postgres           `mapstructure:"postgres" toml:"postgres"`
	Secrets   *Secrets            `mapstructure:"secrets" toml:"secrets"`
	TLSConfig *certs.TLSConfig    `mapstructure:"tls" toml:"tls"`
	Certs     *certs.ServiceCerts `mapstructure:"-" toml:"-"`
}

func FromFile

func FromFile(path string) (*Notifications, error)

FromFile loads the config from the given path, load referenced files (e.g., certs), sets derived config and populates global state (e.g., log level, etc.)

func UnmarshalFromFile

func UnmarshalFromFile(path string) (*Notifications, error)

func (*Notifications) FixupPGURI

func (n *Notifications) FixupPGURI() error

func (*Notifications) ReadCerts

func (n *Notifications) ReadCerts() error

func (*Notifications) SetLogLevel

func (n *Notifications) SetLogLevel() error

type Postgres

type Postgres struct {
	URI          string `mapstructure:"uri" toml:"uri"`
	Database     string `mapstructure:"database" toml:"database"`
	SchemaPath   string `mapstructure:"schema_path" toml:"schema_path"`
	MaxOpenConns int    `mapstructure:"max_open_conns" toml:"max_open_conns"`
	MaxIdleConns int    `mapstructure:"max_idle_conns" toml:"max_idle_conns"`
}

type Secrets

type Secrets struct {
	Host string `mapstructure:"host" toml:"host"`
	Port int    `mapstructure:"port" toml:"port"`
}

type Service

type Service struct {
	ExternalFQDN string `mapstructure:"external_fqdn" toml:"external_fqdn"`
	Host         string `mapstructure:"host" toml:"host"`
	Port         int    `mapstructure:"port" toml:"port"`
	LogLevel     string `mapstructure:"log_level" toml:"log_level"`
}

func (*Service) SetLogLevel

func (s *Service) SetLogLevel() error

Jump to

Keyboard shortcuts

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