yaml

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2019 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FLAG_TEMPORARY = 0x001
	FLAG_LOCAL     = 0x002
	FLAG_INJECT    = 0x004
	FLAG_STATE     = 0x008
	FLAG_DEFAULT   = 0x010

	FLAG_INJECTED = 0x040
	FLAG_IMPLIED  = 0x080
)
View Source
const DOCNODE = "__"
View Source
const MERGEKEY = "<<<"
View Source
const SELF = "_"

Variables

This section is empty.

Functions

func EmbeddedDynaml

func EmbeddedDynaml(root Node) *string

func Equals

func Equals(a, b Node, path []string) (bool, string)

func FindInt

func FindInt(root Node, path ...string) (int64, bool)

func FindIntR

func FindIntR(raw bool, root Node, path ...string) (int64, bool)

func FindString

func FindString(root Node, path ...string) (string, bool)

func FindStringR

func FindStringR(raw bool, root Node, path ...string) (string, bool)

func IsListResolved

func IsListResolved(l []Node) bool

func IsMapResolved

func IsMapResolved(m map[string]Node) bool

func MassageType

func MassageType(value interface{}) interface{}

func Normalize

func Normalize(root Node) (interface{}, error)

func PathComponent

func PathComponent(step string) string

func ToJSON

func ToJSON(root Node) ([]byte, error)

func ValueToJSON

func ValueToJSON(root interface{}) ([]byte, error)

Types

type AnnotatedNode

type AnnotatedNode struct {
	Annotation
	// contains filtered or unexported fields
}

func (AnnotatedNode) EquivalentToNode

func (n AnnotatedNode) EquivalentToNode(o Node) bool

func (AnnotatedNode) GetAnnotation

func (n AnnotatedNode) GetAnnotation() Annotation

func (AnnotatedNode) MarshalYAML

func (n AnnotatedNode) MarshalYAML() (string, interface{}, error)

func (AnnotatedNode) Resolver

func (n AnnotatedNode) Resolver() RefResolver

func (AnnotatedNode) SourceName

func (n AnnotatedNode) SourceName() string

func (AnnotatedNode) Value

func (n AnnotatedNode) Value() interface{}

type Annotation

type Annotation struct {
	NodeFlags
	// contains filtered or unexported fields
}

func EmptyAnnotation

func EmptyAnnotation() Annotation

func NewReferencedAnnotation

func NewReferencedAnnotation(node Node) Annotation

func (Annotation) AddFlags

func (n Annotation) AddFlags(flags NodeFlags) Annotation

func (Annotation) AddIssue

func (n Annotation) AddIssue(error bool, failed bool, issue Issue) Annotation

func (Annotation) AddKeyName

func (n Annotation) AddKeyName(keyName string) Annotation

func (Annotation) Failed

func (n Annotation) Failed() bool

func (Annotation) Flags

func (n Annotation) Flags() NodeFlags

func (Annotation) HasError

func (n Annotation) HasError() bool

func (Annotation) Issue

func (n Annotation) Issue() Issue

func (Annotation) KeyName

func (n Annotation) KeyName() string

func (Annotation) Merged

func (n Annotation) Merged() bool

func (Annotation) Preferred

func (n Annotation) Preferred() bool

func (Annotation) RedirectPath

func (n Annotation) RedirectPath() []string

func (Annotation) ReplaceFlag

func (n Annotation) ReplaceFlag() bool

func (Annotation) SetLocal

func (n Annotation) SetLocal() Annotation

func (Annotation) SetMerged

func (n Annotation) SetMerged() Annotation

func (Annotation) SetPreferred

func (n Annotation) SetPreferred() Annotation

func (Annotation) SetRedirectPath

func (n Annotation) SetRedirectPath(redirect []string) Annotation

func (Annotation) SetReplaceFlag

func (n Annotation) SetReplaceFlag() Annotation

func (Annotation) SetState

func (n Annotation) SetState() Annotation

func (Annotation) SetTemporary

func (n Annotation) SetTemporary() Annotation

func (Annotation) SetUndefined

func (n Annotation) SetUndefined() Annotation

func (Annotation) StandardOverride

func (n Annotation) StandardOverride() bool

func (Annotation) Undefined

func (n Annotation) Undefined() bool

type ComparableValue

type ComparableValue interface {
	EquivalentTo(interface{}) bool
}

type Issue

type Issue struct {
	Issue    string
	Nested   []Issue
	Sequence bool
}

func NewIssue

func NewIssue(msg string, args ...interface{}) Issue

type Node

type Node interface {
	candiedyaml.Marshaler

	Value() interface{}
	SourceName() string
	RedirectPath() []string
	Flags() NodeFlags
	Temporary() bool
	Local() bool
	State() bool
	ReplaceFlag() bool
	Preferred() bool
	Merged() bool
	StandardOverride() bool
	KeyName() string
	HasError() bool
	Failed() bool
	Undefined() bool
	Issue() Issue

	Resolver() RefResolver

	GetAnnotation() Annotation
	EquivalentToNode(Node) bool
}

func AddFlags

func AddFlags(node Node, flags NodeFlags) Node

func Find

func Find(root Node, path ...string) (Node, bool)

func FindR

func FindR(raw bool, root Node, path ...string) (Node, bool)

func IssueNode

func IssueNode(node Node, error bool, failed bool, issue Issue) Node

func KeyNameNode

func KeyNameNode(node Node, keyName string) Node

func LocalNode

func LocalNode(node Node) Node

func MergedNode

func MergedNode(node Node) Node

func NewNode

func NewNode(value interface{}, sourcePath string) Node

func Parse

func Parse(sourceName string, source []byte) (Node, error)

func ParseMulti

func ParseMulti(sourceName string, source []byte) ([]Node, error)

func PreferredNode

func PreferredNode(node Node) Node

func RedirectNode

func RedirectNode(value interface{}, node Node, redirect []string) Node

func ReferencedNode

func ReferencedNode(node Node) Node

func ReplaceNode

func ReplaceNode(value interface{}, node Node, redirect []string) Node

func ReplaceValue

func ReplaceValue(value interface{}, node Node) Node

func ResolverNode

func ResolverNode(node Node, resolver RefResolver) Node

func Sanitize

func Sanitize(sourceName string, root interface{}) (Node, error)

func StateNode

func StateNode(node Node) Node

func SubstituteNode

func SubstituteNode(value interface{}, node Node) Node

func TemporaryNode

func TemporaryNode(node Node) Node

func UndefinedNode

func UndefinedNode(node Node) Node

func UnresolvedListEntryMerge

func UnresolvedListEntryMerge(node Node) (Node, string, bool)

type NodeFlags

type NodeFlags int

func (*NodeFlags) AddFlags

func (f *NodeFlags) AddFlags(flags NodeFlags) *NodeFlags

func (NodeFlags) Default

func (f NodeFlags) Default() bool

func (NodeFlags) Implied

func (f NodeFlags) Implied() bool

func (NodeFlags) Inject

func (f NodeFlags) Inject() bool

func (NodeFlags) Injected

func (f NodeFlags) Injected() bool

func (NodeFlags) Local

func (f NodeFlags) Local() bool

func (*NodeFlags) Overridden

func (f *NodeFlags) Overridden() NodeFlags

func (NodeFlags) PropagateImplied

func (f NodeFlags) PropagateImplied() bool

func (*NodeFlags) SetDefault

func (f *NodeFlags) SetDefault() *NodeFlags

func (*NodeFlags) SetImplied

func (f *NodeFlags) SetImplied() *NodeFlags

func (*NodeFlags) SetInject

func (f *NodeFlags) SetInject() *NodeFlags

func (*NodeFlags) SetLocal

func (f *NodeFlags) SetLocal() *NodeFlags

func (*NodeFlags) SetState

func (f *NodeFlags) SetState() *NodeFlags

func (*NodeFlags) SetTemporary

func (f *NodeFlags) SetTemporary() *NodeFlags

func (NodeFlags) State

func (f NodeFlags) State() bool

func (NodeFlags) Temporary

func (f NodeFlags) Temporary() bool

type NonStringKeyError

type NonStringKeyError struct {
	Key interface{}
}

func (NonStringKeyError) Error

func (e NonStringKeyError) Error() string

type RefResolver

type RefResolver interface {
	FindReference([]string) (Node, bool)
}

Jump to

Keyboard shortcuts

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