conf

package module
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2023 License: Apache-2.0 Imports: 8 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) GetBool

func (e Environment) GetBool(setting string) bool

GetBool get setting as boolean

func (Environment) GetFloat64 added in v1.0.1

func (e Environment) GetFloat64(setting string) float64

GetFloat64 get setting as float64

func (Environment) GetInt

func (e Environment) GetInt(setting string) int

GetInt get setting as int

func (Environment) GetInt64 added in v1.0.1

func (e Environment) GetInt64(setting string) int64

GetInt64 get setting as int64

func (Environment) GetSlice

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

GetSlice get setting as slice of strings

func (Environment) GetSliceInt added in v1.0.4

func (e Environment) GetSliceInt(setting string) (result []int)

GetSliceInt get setting as slice of strings

func (Environment) GetSliceInt64 added in v1.0.4

func (e Environment) GetSliceInt64(setting string) (result []int64)

GetSliceInt64 get setting as slice of strings

func (Environment) GetString added in v1.0.1

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

GetString setting as string

func (Environment) GetUint

func (e Environment) GetUint(setting string) uint

GetUint get setting as uint

func (Environment) GetUint64 added in v1.0.1

func (e Environment) GetUint64(setting string) uint64

GetUint64 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