config

package
v0.0.0-...-a7468fe Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDescription

func GetDescription(cfg interface{}, headerText *string) (string, error)

Types

type App

type App struct {
	Name        string `yaml:"name" env:"APP_NAME" env-default:"go-template"`
	Environment string `yaml:"environment" env:"APP_ENVIRONMENT" env-default:"develop"`
}

type Config

type Config struct {
	App   App   `yaml:"app" env-description:"Application settings"`
	Log   Log   `yaml:"log" env-description:"Logging settings"`
	Trace Trace `yaml:"trace" env-description:"Tracing settings"`
	HTTP  HTTP  `yaml:"http" env-description:"HTTP server settings"`
}

func NewConfig

func NewConfig() (*Config, error)

type HTTP

type HTTP struct {
	Port string `yaml:"port" env:"HTTP_PORT" env-default:"8080"`
}

type Log

type Log struct {
	Level string `yaml:"level" env:"LOG_LEVEL" env-default:"info"`
}

type Trace

type Trace struct {
	Enabled bool   `yaml:"enabled" env:"TRACE_ENABLED" env-default:"true"`
	URL     string `yaml:"url" env:"TRACE_URL"` //FIXME env-default:"http://localhost:9411/api/v2/spans"`
	Name    string `yaml:"name" env:"TRACE_NAME" env-default:"go-template"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳