config

package
v0.0.0-...-c7b9fe3 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiConfig

type ApiConfig struct {
	Address string `yaml:"address" envconfig:"CARGO_API_ADDRESS"`
	Port    uint16 `yaml:"port"    envconfig:"CARGO_API_PORT"`
}

type Config

type Config struct {
	Logging LoggingConfig `yaml:"logging"`
	Api     ApiConfig     `yaml:"api"`
	State   StateConfig   `yaml:"state"`
}

func GetConfig

func GetConfig() *Config

Return global config instance

func Load

func Load(configFile string) (*Config, error)

type LoggingConfig

type LoggingConfig struct {
	Level string `yaml:"level" envconfig:"CARGO_LOGGING_LEVEL"`
}

type StateConfig

type StateConfig struct {
	DatabaseDriver string `yaml:"driver" envconfig:"CARGO_STATE_DB_DRIVER"`
	DatabaseDsn    string `yaml:"dsn"    envconfig:"CARGO_STATE_DB_DSN"`
}

Jump to

Keyboard shortcuts

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