config

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config map[string]*Variable

A map of configuration Variable entries.

func NewConfig

func NewConfig(vars ...*Variable) *Config

Create a new Config with the given Variable objects.

func Parse

func Parse(variables []string, separator string) *Config

Parse the given variable strings into a Config object.

func (Config) DeleteVariable

func (c Config) DeleteVariable(v *Variable)

Delete the Variable that matches the given Variable.

func (Config) Keys

func (c Config) Keys() []string

Get the keys registered in the current Config.

func (Config) MapInterfaces

func (c Config) MapInterfaces() map[string]*interface{}

Map the Config to a map of interface{} types.

func (Config) SetVariable

func (c Config) SetVariable(v *Variable)

Set a Variable on the current Config.

func (Config) Variable

func (c Config) Variable(key string) (v *Variable, e error)

Get the Variable for the given Variable.Key.

type Variable

type Variable struct {
	Key   string
	Value interface{}
}

A struct representing a configuration entry by Key and Value.

Directories

Path Synopsis
Package encoding provides interfaces for configuration encoders and decoders.
Package encoding provides interfaces for configuration encoders and decoders.
json
Package json implements an encoder and decoder for a JSON representation of config.Variable.
Package json implements an encoder and decoder for a JSON representation of config.Variable.
text
Package text implements an encoder and decoder for a text based representation of config.Variable.
Package text implements an encoder and decoder for a text based representation of config.Variable.
TODO: > Write unit tests > Document symbols
TODO: > Write unit tests > Document symbols

Jump to

Keyboard shortcuts

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