hades

package module
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2019 License: MIT Imports: 4 Imported by: 0

README

Dash

Easily Manage Config Files In Go

Example

config.yaml

test:
  testInt: 32
  testFloat: 32.2
  testBool: true
  testString: "hey"
  testList:
    - "a"
    - "b"
    - "c'

main.go

// provide it with the filename and different path where config file could be
config := dash.GetConfig("test.yaml", []string{"path1", "path2"})
test := config.Map("test")
testInt := test.Int("testInt")
testFloat := test.Float("testFloat")
testBool := test.Bool("testBool")
testList := test.List("testList")

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// contains filtered or unexported fields
}

Config allows easy management of map config data

func GetConfig

func GetConfig(file string, paths []string) Config

GetConfig returns a map of all config in a toml file

func (Config) Bool

func (config Config) Bool(name string) bool

Bool returns a bool from config

func (Config) Float

func (config Config) Float(name string) float64

Float returns an float64 from config

func (Config) Int

func (config Config) Int(name string) int

Int returns an int from config

func (Config) Interface

func (config Config) Interface(name string) interface{}

Interface returns an interface value from config

func (Config) List

func (config Config) List(name string) []interface{}

List returns an list from config

func (Config) Map

func (config Config) Map(name string) Config

Map returns a sub map from config

func (Config) Str

func (config Config) Str(name string) string

Str returns a string from config

Jump to

Keyboard shortcuts

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