conf

package module
v0.0.0-...-af3ddda Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2015 License: MIT Imports: 7 Imported by: 0

README

conf

Circle CI

GoDoc

License

conf is MIT licensed, details can be found here.

Documentation

Overview

Package conf implements a localized database for storing and writing data in a file.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

type DB interface {
	Load(data interface{}) error
	Save(data interface{}) error
}

DB represents a local database which can load and save data.

type JSON

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

JSON implements DB for a json-based local db.

func NewJSON

func NewJSON(path string) (*JSON, error)

NewJSON creates a new JSON local database at the given location.

func (*JSON) Load

func (j *JSON) Load(data interface{}) error

Load decodes a json file into the given data.

func (*JSON) Save

func (j *JSON) Save(data interface{}) error

Save encodes the given data to a json file.

type YAML

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

YAML implements DB for a yaml-based local db.

func NewYAML

func NewYAML(path string) (*YAML, error)

NewYAML creates a new YAML local database at the given location.

func (*YAML) Load

func (y *YAML) Load(data interface{}) error

Load decodes a yaml file into the given data.

func (*YAML) Save

func (y *YAML) Save(data interface{}) error

Save encodes the given data into a yaml file.

Jump to

Keyboard shortcuts

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