confighelper

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 8, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conf

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

Conf encompasses the anonymous json object for a template config.

func New

func New(path string) (*Conf, error)

New will create a new Conf using the contents contain in the file found in "path"

func (*Conf) GetAllValues

func (c *Conf) GetAllValues() ([]Setting, error)

GetAllValues gets all of the overridable variables from the Conf

func (*Conf) Object

func (c *Conf) Object() interface{}

Object Returns the Conf as an anonymous object.

func (*Conf) SetValues

func (c *Conf) SetValues(settings []Setting) error

SetValues will take an array of settings to put each one into the Conf. If the setting already exists it will update the value, else it will add the new setting.

type Setting

type Setting struct {
	Name  string
	Value string
}

Setting is a simple struct to represent a setting in a Conf. This is used when trying to Get or Set values in the Conf.

Jump to

Keyboard shortcuts

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