conf

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

README

go-yaml-conf

Yaml configuration for go app

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Env = flag.String("env", "local", "Please run app with environment -> ./app -env environment")

Functions

func GetEnv

func GetEnv() string

GetEnv Return current environment, dev is default

Types

type Environment

type Environment struct {
	Name *string
}
var Global Environment

Global settings from config/global.yaml

var Local Environment

Local settings from config/{environment}.yaml

func (Environment) Get

func (e Environment) Get(setting string) (result string)

Get setting as string

func (Environment) GetBool

func (e Environment) GetBool(setting string) bool

GetBool get setting as boolean

func (Environment) GetFloat

func (e Environment) GetFloat(setting string) float64

GetFloat get setting as float64

func (Environment) GetInt

func (e Environment) GetInt(setting string) int64

GetInt get setting as int64

func (Environment) GetSlice

func (e Environment) GetSlice(setting string) (result []string)

GetSlice get setting as slice of strings

func (Environment) GetUint

func (e Environment) GetUint(setting string) uint64

GetUint get setting as uint64

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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