quick

package
v0.0.0-...-65e45ac Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2016 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckData

func CheckData(data interface{}) error

CheckData - checks the validity of config data. Data should be of type struct and contain a string type field called "Version".

func CheckVersion

func CheckVersion(filename string, version string) (bool, error)

CheckVersion - loads json and compares the version number provided returns back true or false - any failure is returned as error.

func FormatJSONSyntaxError

func FormatJSONSyntaxError(data io.Reader, sErr *json.SyntaxError) error

FormatJSONSyntaxError generates a pretty printed json syntax error since golang doesn't provide an easy way to report the location of the error

Types

type Config

type Config interface {
	String() string
	Version() string
	Save(string) error
	Load(string) error
	Data() interface{}
	Diff(Config) ([]structs.Field, error)
	DeepDiff(Config) ([]structs.Field, error)
}

Config - generic config interface functions

func Load

func Load(filename string, data interface{}) (Config, error)

Load - loads json config from filename for the a given struct data

func New

func New(data interface{}) (Config, error)

New - instantiate a new config

Jump to

Keyboard shortcuts

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