value

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: May 27, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package value provides types that can be used to represent structured data that include comments

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Interface added in v0.8.0

type Interface interface {
	Get(...interface{}) Interface
	Value() interface{}
	Comment() string
	SetComment(string)
	Nodes() []Node
}

Interface is the main interface for the value package

func New

func New(in interface{}) Interface

New returns a new Interface from the provided value

type List added in v0.8.0

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

List represents a slice value

func (*List) Comment added in v0.8.0

func (v *List) Comment() string

Comment returns the List's comment

func (*List) Get added in v0.8.0

func (v *List) Get(path ...interface{}) Interface

Get returns an element from the List

func (*List) Nodes added in v0.8.0

func (v *List) Nodes() []Node

Nodes returns the contents of the List as a list of []Node

func (*List) SetComment added in v0.8.0

func (v *List) SetComment(c string)

SetComment sets the List's comment

func (*List) Value added in v0.8.0

func (v *List) Value() interface{}

Value returns the value of the List

type Map added in v0.8.0

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

Map represents a map[string]interface value

func (*Map) Comment added in v0.8.0

func (v *Map) Comment() string

Comment returns the Map's comment

func (*Map) Get added in v0.8.0

func (v *Map) Get(path ...interface{}) Interface

Get returns an element from the Map

func (*Map) Keys added in v0.8.0

func (v *Map) Keys() []string

Keys returns the Map's keys

func (*Map) Nodes added in v0.8.0

func (v *Map) Nodes() []Node

Nodes returns the contents of the Map as a list of []Node

func (*Map) Set added in v0.8.1

func (v *Map) Set(key string, value interface{})

Set sets the value of a key within the Map

func (*Map) SetComment added in v0.8.0

func (v *Map) SetComment(c string)

SetComment sets the Map's comment

func (*Map) Value added in v0.8.0

func (v *Map) Value() interface{}

Value returns the value of the Map

type Node added in v0.8.0

type Node struct {
	Path    []interface{}
	Content Interface
}

Node is an element of a structure data value

func (Node) String added in v0.8.0

func (n Node) String() string

type Scalar added in v0.8.0

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

Scalar represents an arbitrary (scalar) interface{} value

func (*Scalar) Comment added in v0.8.0

func (v *Scalar) Comment() string

Comment returns the Scalar's comment

func (*Scalar) Get added in v0.8.0

func (v *Scalar) Get(path ...interface{}) Interface

Get returns the Scalar's value. Only an empty path is valid.

func (*Scalar) Nodes added in v0.8.0

func (v *Scalar) Nodes() []Node

Nodes returns the Scalar's value in a list of []Node

func (*Scalar) SetComment added in v0.8.0

func (v *Scalar) SetComment(c string)

SetComment sets the Scalar's comment

func (*Scalar) Value added in v0.8.0

func (v *Scalar) Value() interface{}

Value returns the value of the Scalar

Jump to

Keyboard shortcuts

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