config

package
v0.7.7 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2022 License: MIT Imports: 8 Imported by: 25

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

func ColumnLeft added in v0.7.4

func ColumnLeft(name string)

ColumnLeft moves the column with given name up one position, if possible

func ColumnRight added in v0.7.4

func ColumnRight(name string)

ColumnRight moves the column with given name up one position, if possible

func ColumnToggle added in v0.7.4

func ColumnToggle(name string)

ColumnToggle toggles the enabled status of a given column name

func ColumnsString added in v0.7.4

func ColumnsString() string

ColumnsString returns an ordered and comma-delimited string of currently enabled Columns

func EnabledColumns added in v0.7.4

func EnabledColumns() (a []string)

EnabledColumns returns an ordered array of enabled column names

func GetSwitchVal

func GetSwitchVal(k string) bool

GetSwitchVal returns Switch value by key

func GetVal

func GetVal(k string) string

GetVal gets Param value by key

func Init

func Init()

func Read added in v0.7.1

func Read() error

func SetColumns added in v0.7.4

func SetColumns(names []string)

Set Column order and enabled status from one or more provided Column names

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 Column added in v0.7.4

type Column struct {
	Name    string
	Label   string
	Enabled bool
}

type File added in v0.7.2

type File 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

GetSwitch returns Switch by key

Jump to

Keyboard shortcuts

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