data

package
v0.0.0-...-3832f50 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2017 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JsonProcessor

type JsonProcessor struct{}

JsonProcessor handles transforming Objects into JSON and vice-versa

func (*JsonProcessor) Marshal

func (j *JsonProcessor) Marshal(data Object) (*bytes.Buffer, error)

func (*JsonProcessor) UnmarshalFile

func (j *JsonProcessor) UnmarshalFile(file string) (Object, error)

UnmarshalFile will read the contents of file, unmarshal the json, and convert any encrypted data fields

type Object

type Object map[string]interface{}

Object represent a structured data map with string keys

func (Object) DecryptValues

func (object Object) DecryptValues(label string, file string) error

DecryptValue decrypts encrypted values in an object

type Processor

type Processor interface {
	Marshal(Object) (*bytes.Buffer, error)
	UnmarshalFile(string) (Object, error)
}

Processor manages transforming objects into specific data formats

func NewJsonProcessor

func NewJsonProcessor() Processor

NewJsonProcessor returns a JSON backed processor.

func NewYamlProcessor

func NewYamlProcessor() Processor

NewYamlProcessor returns an instance of a YamlProcessor

type YamlProcessor

type YamlProcessor struct{}

func (*YamlProcessor) Marshal

func (y *YamlProcessor) Marshal(data Object) (*bytes.Buffer, error)

Marshal data string into a yaml file

func (*YamlProcessor) UnmarshalFile

func (y *YamlProcessor) UnmarshalFile(file string) (Object, error)

Jump to

Keyboard shortcuts

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