config

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2018 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	GlobalParams   []*Param
	GlobalSwitches []*Switch
)

Functions

func GetSwitchVal

func GetSwitchVal(k string) bool

Return Switch value by key

func GetVal

func GetVal(k string) string

Get Param value by key

func Init

func Init()

func Read added in v0.7.1

func Read() error

func Toggle

func Toggle(k string)

Toggle a boolean switch

func Update

func Update(k, v string)

Set param value

func UpdateSwitch added in v0.7.1

func UpdateSwitch(k string, val bool)

func Write added in v0.7.1

func Write() (path string, err error)

Types

type ConfigFile added in v0.7.1

type ConfigFile struct {
	Options map[string]string `toml:"options"`
	Toggles map[string]bool   `toml:"toggles"`
}

type Param

type Param struct {
	Key   string
	Val   string
	Label string
}

func Get

func Get(k string) *Param

Get Param by key

type Switch

type Switch struct {
	Key   string
	Val   bool
	Label string
}

func GetSwitch

func GetSwitch(k string) *Switch

Return Switch by key

Jump to

Keyboard shortcuts

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