Documentation ¶
Index ¶
- func NewASTFromInterface(val interface{}) interface{}
- func NewInterfaceFromAST(val interface{}) interface{}
- func PlainUnmarshal(data []byte, out interface{}) error
- type Array
- func (n *Array) AddValue(val interface{}) error
- func (n *Array) DeepCopy() *Array
- func (n *Array) DeepCopyAsInterface() interface{}
- func (n *Array) DeepCopyAsNode() Node
- func (n *Array) GetAnnotations() interface{}
- func (n *Array) GetMetas() []*Meta
- func (n *Array) GetPosition() *filepos.Position
- func (n *Array) GetValues() []interface{}
- func (n *Array) MarshalJSON() ([]byte, error)
- func (n *Array) MarshalYAML() (interface{}, error)
- func (n *Array) ResetValue()
- func (n *Array) SetAnnotations(anns interface{})
- func (n *Array) SetValue(val interface{}) error
- type ArrayItem
- func (n *ArrayItem) AddValue(val interface{}) error
- func (n *ArrayItem) DeepCopy() *ArrayItem
- func (n *ArrayItem) DeepCopyAsInterface() interface{}
- func (n *ArrayItem) DeepCopyAsNode() Node
- func (n *ArrayItem) GetAnnotations() interface{}
- func (n *ArrayItem) GetMetas() []*Meta
- func (n *ArrayItem) GetPosition() *filepos.Position
- func (n *ArrayItem) GetValues() []interface{}
- func (n *ArrayItem) MarshalJSON() ([]byte, error)
- func (n *ArrayItem) MarshalYAML() (interface{}, error)
- func (n *ArrayItem) ResetValue()
- func (n *ArrayItem) SetAnnotations(anns interface{})
- func (n *ArrayItem) SetValue(val interface{}) error
- type DocSetOpts
- type Document
- func (n *Document) AddValue(val interface{}) error
- func (d *Document) AsInterface(opts InterfaceConvertOpts) interface{}
- func (n *Document) DeepCopy() *Document
- func (n *Document) DeepCopyAsInterface() interface{}
- func (n *Document) DeepCopyAsNode() Node
- func (n *Document) GetAnnotations() interface{}
- func (n *Document) GetMetas() []*Meta
- func (n *Document) GetPosition() *filepos.Position
- func (n *Document) GetValues() []interface{}
- func (d *Document) IsEmpty() bool
- func (n *Document) MarshalJSON() ([]byte, error)
- func (n *Document) MarshalYAML() (interface{}, error)
- func (n *Document) ResetValue()
- func (n *Document) SetAnnotations(anns interface{})
- func (n *Document) SetValue(val interface{}) error
- type DocumentPrinter
- type DocumentSet
- func (n *DocumentSet) AddValue(val interface{}) error
- func (d *DocumentSet) AsBytes() ([]byte, error)
- func (d *DocumentSet) AsBytesWithPrinter(printerFunc func(io.Writer) DocumentPrinter) ([]byte, error)
- func (d *DocumentSet) AsSourceBytes() ([]byte, bool)
- func (n *DocumentSet) DeepCopy() *DocumentSet
- func (n *DocumentSet) DeepCopyAsInterface() interface{}
- func (n *DocumentSet) DeepCopyAsNode() Node
- func (n *DocumentSet) GetAnnotations() interface{}
- func (n *DocumentSet) GetMetas() []*Meta
- func (n *DocumentSet) GetPosition() *filepos.Position
- func (n *DocumentSet) GetValues() []interface{}
- func (n *DocumentSet) MarshalJSON() ([]byte, error)
- func (n *DocumentSet) MarshalYAML() (interface{}, error)
- func (d *DocumentSet) Print(writer io.Writer)
- func (n *DocumentSet) ResetValue()
- func (n *DocumentSet) SetAnnotations(anns interface{})
- func (n *DocumentSet) SetValue(val interface{}) error
- type FilePositionPrinter
- type FilePositionPrinterOpts
- type InterfaceConvertOpts
- type JSONPrinter
- type Map
- func (n *Map) AddValue(val interface{}) error
- func (n *Map) DeepCopy() *Map
- func (n *Map) DeepCopyAsInterface() interface{}
- func (n *Map) DeepCopyAsNode() Node
- func (n *Map) GetAnnotations() interface{}
- func (n *Map) GetMetas() []*Meta
- func (n *Map) GetPosition() *filepos.Position
- func (n *Map) GetValues() []interface{}
- func (n *Map) MarshalJSON() ([]byte, error)
- func (n *Map) MarshalYAML() (interface{}, error)
- func (n *Map) ResetValue()
- func (n *Map) SetAnnotations(anns interface{})
- func (n *Map) SetValue(val interface{}) error
- type MapItem
- func (n *MapItem) AddValue(val interface{}) error
- func (n *MapItem) DeepCopy() *MapItem
- func (n *MapItem) DeepCopyAsInterface() interface{}
- func (n *MapItem) DeepCopyAsNode() Node
- func (n *MapItem) GetAnnotations() interface{}
- func (n *MapItem) GetMetas() []*Meta
- func (n *MapItem) GetPosition() *filepos.Position
- func (n *MapItem) GetValues() []interface{}
- func (n *MapItem) MarshalJSON() ([]byte, error)
- func (n *MapItem) MarshalYAML() (interface{}, error)
- func (n *MapItem) ResetValue()
- func (n *MapItem) SetAnnotations(anns interface{})
- func (n *MapItem) SetValue(val interface{}) error
- type Meta
- type MetaSlice
- type Node
- type Parser
- type Printer
- type PrinterOpts
- type WrappedFilePositionPrinter
- type YAMLPrinter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewASTFromInterface ¶
func NewASTFromInterface(val interface{}) interface{}
func NewInterfaceFromAST ¶ added in v0.15.0
func NewInterfaceFromAST(val interface{}) interface{}
func PlainUnmarshal ¶
Types ¶
type Array ¶
type Array struct { Metas []*Meta Items []*ArrayItem Position *filepos.Position // contains filtered or unexported fields }
func (*Array) DeepCopyAsInterface ¶
func (n *Array) DeepCopyAsInterface() interface{}
func (*Array) DeepCopyAsNode ¶
func (*Array) GetAnnotations ¶
func (n *Array) GetAnnotations() interface{}
func (*Array) GetPosition ¶
func (*Array) MarshalJSON ¶ added in v0.15.0
func (*Array) MarshalYAML ¶
func (*Array) ResetValue ¶
func (n *Array) ResetValue()
func (*Array) SetAnnotations ¶
func (n *Array) SetAnnotations(anns interface{})
type ArrayItem ¶
type ArrayItem struct { Metas []*Meta Value interface{} Position *filepos.Position // contains filtered or unexported fields }
func (*ArrayItem) DeepCopyAsInterface ¶
func (n *ArrayItem) DeepCopyAsInterface() interface{}
func (*ArrayItem) DeepCopyAsNode ¶
func (*ArrayItem) GetAnnotations ¶
func (n *ArrayItem) GetAnnotations() interface{}
func (*ArrayItem) GetPosition ¶
func (*ArrayItem) MarshalJSON ¶ added in v0.15.0
func (*ArrayItem) MarshalYAML ¶
func (*ArrayItem) ResetValue ¶
func (n *ArrayItem) ResetValue()
func (*ArrayItem) SetAnnotations ¶
func (n *ArrayItem) SetAnnotations(anns interface{})
type DocSetOpts ¶ added in v0.4.0
type Document ¶
type Document struct { Metas []*Meta Value interface{} Position *filepos.Position // contains filtered or unexported fields }
func (*Document) AsInterface ¶
func (d *Document) AsInterface(opts InterfaceConvertOpts) interface{}
func (*Document) DeepCopyAsInterface ¶
func (n *Document) DeepCopyAsInterface() interface{}
func (*Document) DeepCopyAsNode ¶
func (*Document) GetAnnotations ¶
func (n *Document) GetAnnotations() interface{}
func (*Document) GetPosition ¶
func (*Document) MarshalJSON ¶ added in v0.15.0
func (*Document) MarshalYAML ¶
func (*Document) ResetValue ¶
func (n *Document) ResetValue()
func (*Document) SetAnnotations ¶
func (n *Document) SetAnnotations(anns interface{})
type DocumentPrinter ¶ added in v0.14.0
type DocumentSet ¶
type DocumentSet struct { Metas []*Meta AllMetas []*Meta Items []*Document Position *filepos.Position // contains filtered or unexported fields }
func NewDocumentSetFromBytes ¶
func NewDocumentSetFromBytes(data []byte, associatedName string) (*DocumentSet, error)
func NewDocumentSetFromBytesWithOpts ¶ added in v0.4.0
func NewDocumentSetFromBytesWithOpts(data []byte, opts DocSetOpts) (*DocumentSet, error)
func (*DocumentSet) AddValue ¶
func (n *DocumentSet) AddValue(val interface{}) error
func (*DocumentSet) AsBytes ¶
func (d *DocumentSet) AsBytes() ([]byte, error)
func (*DocumentSet) AsBytesWithPrinter ¶ added in v0.14.0
func (d *DocumentSet) AsBytesWithPrinter(printerFunc func(io.Writer) DocumentPrinter) ([]byte, error)
func (*DocumentSet) AsSourceBytes ¶
func (d *DocumentSet) AsSourceBytes() ([]byte, bool)
AsSourceBytes() returns bytes used to make original DocumentSet. Any changes made to the DocumentSet are not reflected in any way
func (*DocumentSet) DeepCopy ¶
func (n *DocumentSet) DeepCopy() *DocumentSet
func (*DocumentSet) DeepCopyAsInterface ¶
func (n *DocumentSet) DeepCopyAsInterface() interface{}
func (*DocumentSet) DeepCopyAsNode ¶
func (n *DocumentSet) DeepCopyAsNode() Node
func (*DocumentSet) GetAnnotations ¶
func (n *DocumentSet) GetAnnotations() interface{}
func (*DocumentSet) GetMetas ¶
func (n *DocumentSet) GetMetas() []*Meta
func (*DocumentSet) GetPosition ¶
func (n *DocumentSet) GetPosition() *filepos.Position
func (*DocumentSet) GetValues ¶
func (n *DocumentSet) GetValues() []interface{}
func (*DocumentSet) MarshalJSON ¶ added in v0.15.0
func (n *DocumentSet) MarshalJSON() ([]byte, error)
func (*DocumentSet) MarshalYAML ¶
func (n *DocumentSet) MarshalYAML() (interface{}, error)
func (*DocumentSet) Print ¶
func (d *DocumentSet) Print(writer io.Writer)
func (*DocumentSet) ResetValue ¶
func (n *DocumentSet) ResetValue()
func (*DocumentSet) SetAnnotations ¶
func (n *DocumentSet) SetAnnotations(anns interface{})
func (*DocumentSet) SetValue ¶
func (n *DocumentSet) SetValue(val interface{}) error
type FilePositionPrinter ¶ added in v0.14.0
type FilePositionPrinter struct {
// contains filtered or unexported fields
}
func NewFilePositionPrinter ¶ added in v0.14.0
func NewFilePositionPrinter(writer io.Writer) *FilePositionPrinter
func NewFilePositionPrinterWithOpts ¶ added in v0.14.0
func NewFilePositionPrinterWithOpts(writer io.Writer, opts FilePositionPrinterOpts) *FilePositionPrinter
func (*FilePositionPrinter) Print ¶ added in v0.14.0
func (p *FilePositionPrinter) Print(val interface{})
func (*FilePositionPrinter) PrintStr ¶ added in v0.14.0
func (p *FilePositionPrinter) PrintStr(val interface{}) string
type FilePositionPrinterOpts ¶ added in v0.14.0
type FilePositionPrinterOpts struct{}
type InterfaceConvertOpts ¶
type JSONPrinter ¶ added in v0.14.0
type JSONPrinter struct {
// contains filtered or unexported fields
}
func NewJSONPrinter ¶ added in v0.14.0
func NewJSONPrinter(writer io.Writer) JSONPrinter
func (JSONPrinter) Print ¶ added in v0.14.0
func (p JSONPrinter) Print(item *Document) error
type Map ¶
type Map struct { Metas []*Meta Items []*MapItem Position *filepos.Position // contains filtered or unexported fields }
func (*Map) DeepCopyAsInterface ¶
func (n *Map) DeepCopyAsInterface() interface{}
func (*Map) DeepCopyAsNode ¶
func (*Map) GetAnnotations ¶
func (n *Map) GetAnnotations() interface{}
func (*Map) GetPosition ¶
func (*Map) MarshalJSON ¶ added in v0.15.0
func (*Map) MarshalYAML ¶
func (*Map) ResetValue ¶
func (n *Map) ResetValue()
func (*Map) SetAnnotations ¶
func (n *Map) SetAnnotations(anns interface{})
type MapItem ¶
type MapItem struct { Metas []*Meta Key interface{} Value interface{} Position *filepos.Position // contains filtered or unexported fields }
func (*MapItem) DeepCopyAsInterface ¶
func (n *MapItem) DeepCopyAsInterface() interface{}
func (*MapItem) DeepCopyAsNode ¶
func (*MapItem) GetAnnotations ¶
func (n *MapItem) GetAnnotations() interface{}
func (*MapItem) GetPosition ¶
func (*MapItem) MarshalJSON ¶ added in v0.15.0
func (*MapItem) MarshalYAML ¶
func (*MapItem) ResetValue ¶
func (n *MapItem) ResetValue()
func (*MapItem) SetAnnotations ¶
func (n *MapItem) SetAnnotations(anns interface{})
type Node ¶
type Node interface { GetPosition() *filepos.Position GetValues() []interface{} // ie children SetValue(interface{}) error AddValue(interface{}) error ResetValue() GetMetas() []*Meta GetAnnotations() interface{} SetAnnotations(interface{}) DeepCopyAsInterface() interface{} DeepCopyAsNode() Node // contains filtered or unexported methods }
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
func (*Parser) ParseBytes ¶
func (p *Parser) ParseBytes(data []byte, associatedName string) (*DocumentSet, error)
type Printer ¶
type Printer struct {
// contains filtered or unexported fields
}
func NewPrinter ¶
func NewPrinterWithOpts ¶
func NewPrinterWithOpts(writer io.Writer, opts PrinterOpts) Printer
type PrinterOpts ¶
type PrinterOpts struct {
ExcludeRefs bool
}
type WrappedFilePositionPrinter ¶ added in v0.14.0
type WrappedFilePositionPrinter struct {
Printer *FilePositionPrinter
}
func (WrappedFilePositionPrinter) Print ¶ added in v0.14.0
func (p WrappedFilePositionPrinter) Print(item *Document) error
type YAMLPrinter ¶ added in v0.14.0
type YAMLPrinter struct {
// contains filtered or unexported fields
}
func NewYAMLPrinter ¶ added in v0.14.0
func NewYAMLPrinter(writer io.Writer) *YAMLPrinter
func (*YAMLPrinter) Print ¶ added in v0.14.0
func (p *YAMLPrinter) Print(item *Document) error
Click to show internal directories.
Click to hide internal directories.