config

package
v0.0.0-...-e650048 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2024 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Load

func Load(path string) (*koanf.Koanf, error)

Loads a YAML configuration file from the given path and overrides it with environment variables. If the file cannot be loaded or parsed as YAML, an error is returned. Requires a default config of any kind, will try to serialize the configuration to outConfig if present (needs to be a pointer to a struct).

Types

type Backend

type Backend struct {
	Metrics bool              `yaml:"metrics"`
	Port    int               `yaml:"port"`
	Storage string            `yaml:"storage"`
	Users   map[string]string `yaml:"users"`
}

type BackendConfig

type BackendConfig struct {
	Backend   `yaml:"backend"`
	Collector `yaml:"collector"`
	Postgres  `yaml:"postgres"`
	NATS      `yaml:"nats"`
}

type Collector

type Collector struct {
	Port int `yaml:"port"`
}

type NATS

type NATS struct {
	Protocol string `yaml:"protocol"`
	Host     string `yaml:"host"`
	Port     int    `yaml:"port"`
	Token    string `yaml:"token"`
}

type Postgres

type Postgres struct {
	Host         string   `yaml:"host"`
	Port         int      `yaml:"port"`
	DatabaseName string   `yaml:"dbname"`
	Username     string   `yaml:"username"`
	Password     string   `yaml:"password"`
	Params       []string `yaml:"params"`
}

Jump to

Keyboard shortcuts

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