Documentation
¶
Index ¶
- Constants
- Variables
- func FindYAMLNode(node *yaml.Node, path ...PathElement) *yaml.Node
- func IsBool(value Value) bool
- func IsFloat(value Value) bool
- func IsInteger(value Value) bool
- func IsList(value Value) bool
- func IsMap(value Value) bool
- func IsNull(value Value) bool
- func IsString(value Value) bool
- func IsTime(value Value) bool
- func MergeMaps(target Map, source Map, mergeLists bool)
- func Read(reader io.Reader, format string, locate bool) (Map, Locator, error)
- func ReadFromURL(url urlpkg.URL, locate bool) (Map, Locator, error)
- func ReadJSON(reader io.Reader, locate bool) (Map, Locator, error)
- func ReadYAML(reader io.Reader, locate bool) (Map, Locator, error)
- func StringMapPutNested(map_ StringMap, key string, value string) error
- func ToYAMLDocumentNode(value Value, verbose bool) *yaml.Node
- func ToYAMLNode(value Value, verbose bool) *yaml.Node
- func TypeName(value Value) string
- type List
- type Locator
- type Map
- type Node
- func (self *Node) Append(value interface{}) bool
- func (self *Node) Boolean(allowNil bool) (bool, bool)
- func (self *Node) Float(allowNil bool) (float64, bool)
- func (self *Node) Get(key string) *Node
- func (self *Node) Integer(allowNil bool) (int64, bool)
- func (self *Node) List(allowNil bool) (List, bool)
- func (self *Node) Map(allowNil bool) (Map, bool)
- func (self *Node) Put(key string, value interface{}) bool
- func (self *Node) String(allowNil bool) (string, bool)
- func (self *Node) StringMap(allowNil bool) (StringMap, bool)
- func (self *Node) UnsignedInteger(allowNil bool) (uint64, bool)
- type Path
- type PathElement
- type PathElementType
- type StringMap
- type TypeValidator
- type Value
- type YAMLLocator
Constants ¶
const ( FieldPathType = iota MapPathType ListPathType SequencedListPathType )
Variables ¶
var NoNode = &Node{nil, nil, ""}
Functions ¶
func FindYAMLNode ¶
func FindYAMLNode(node *yaml.Node, path ...PathElement) *yaml.Node
func IsInteger ¶ added in v0.12.0
int64, int32, int16, int8, int, uint64, uint32, uint16, uint8, uint
func StringMapPutNested ¶
TODO: use Node instead
func ToYAMLDocumentNode ¶ added in v0.12.0
func ToYAMLNode ¶ added in v0.12.0
Types ¶
type List ¶
type List = []Value
Note: This is just a convenient alias, *not* a type. An extra type would ensure more strictness but would make life more complicated than it needs to be. That said, if we *do* want to make this into a type, we need to make sure not to add any methods to the type, otherwise the goja JavaScript engine will treat it as a host object instead of a regular JavaScript dict object.
type Map ¶
Note: This is just a convenient alias, *not* a type. An extra type would ensure more strictness but would make life more complicated than it needs to be. That said, if we *do* want to make this into a type, we need to make sure not to add any methods to the type, otherwise the goja JavaScript engine will treat it as a host object instead of a regular JavaScript dict object.
func EnsureMaps ¶
type Node ¶ added in v0.14.0
type Node struct { Data interface{} // contains filtered or unexported fields }
type Path ¶
type Path []PathElement
func (Path) Append ¶ added in v0.13.0
func (self Path) Append(element PathElement) Path
func (Path) AppendField ¶ added in v0.13.0
func (Path) AppendList ¶ added in v0.13.0
func (Path) AppendSequencedList ¶ added in v0.14.0
type PathElement ¶
type PathElement struct { Type PathElementType Value interface{} // string for FieldPathType and MapPathType, int for ListPathType and SequencedListPathType }
func NewFieldPathElement ¶
func NewFieldPathElement(name string) PathElement
func NewListPathElement ¶
func NewListPathElement(index int) PathElement
func NewMapPathElement ¶
func NewMapPathElement(name string) PathElement
func NewSequencedListPathElement ¶ added in v0.14.0
func NewSequencedListPathElement(index int) PathElement
type PathElementType ¶ added in v0.14.0
type PathElementType uint8
type TypeValidator ¶ added in v0.12.0
type YAMLLocator ¶
type YAMLLocator struct {
RootNode *yaml.Node
}
func NewYAMLLocator ¶
func NewYAMLLocator(rootNode *yaml.Node) *YAMLLocator
func (*YAMLLocator) Locate ¶
func (self *YAMLLocator) Locate(path ...PathElement) (int, int, bool)
Locator interface