Documentation ¶
Overview ¶
Package yamlmeta parses YAML streams into a data structure (tree of yamlmeta.Node's) on which comments and metadata can be attached.
Index ¶
- func NewASTFromInterface(val interface{}) interface{}
- func NewASTFromInterfaceWithNoPosition(val interface{}) interface{}
- func NewASTFromInterfaceWithPosition(val interface{}, defaultPosition *filepos.Position) interface{}
- func NewGoFromAST(val interface{}) interface{}
- func NewValue(val interface{}) interface{}
- func PlainMarshal(in interface{}) ([]byte, error)
- func PlainUnmarshal(data []byte, out interface{}) error
- func TypeName(val interface{}) string
- func Walk(n Node, v Visitor) error
- func WalkWithParent(node Node, parent Node, path string, v VisitorWithParent) error
- type Array
- func (a *Array) AddValue(val interface{}) error
- func (a *Array) DeepCopy() *Array
- func (a *Array) DeepCopyAsInterface() interface{}
- func (a *Array) DeepCopyAsNode() Node
- func (a *Array) GetAnnotations() interface{}
- func (a *Array) GetComments() []*Comment
- func (a *Array) GetMeta(name string) interface{}
- func (a *Array) GetPosition() *filepos.Position
- func (a *Array) GetValues() []interface{}
- func (a *Array) MarshalJSON() ([]byte, error)
- func (a *Array) MarshalYAML() (interface{}, error)
- func (a *Array) ResetValue()
- func (a *Array) SetAnnotations(anns interface{})
- func (a *Array) SetComments(c []*Comment)
- func (a *Array) SetMeta(name string, data interface{})
- func (a *Array) SetPosition(position *filepos.Position)
- func (a *Array) SetValue(val interface{}) error
- type ArrayItem
- func (ai *ArrayItem) AddValue(val interface{}) error
- func (ai *ArrayItem) DeepCopy() *ArrayItem
- func (ai *ArrayItem) DeepCopyAsInterface() interface{}
- func (ai *ArrayItem) DeepCopyAsNode() Node
- func (ai *ArrayItem) GetAnnotations() interface{}
- func (ai *ArrayItem) GetComments() []*Comment
- func (ai *ArrayItem) GetMeta(name string) interface{}
- func (ai *ArrayItem) GetPosition() *filepos.Position
- func (ai *ArrayItem) GetValues() []interface{}
- func (ai *ArrayItem) MarshalJSON() ([]byte, error)
- func (ai *ArrayItem) MarshalYAML() (interface{}, error)
- func (ai *ArrayItem) ResetValue()
- func (ai *ArrayItem) SetAnnotations(anns interface{})
- func (ai *ArrayItem) SetComments(c []*Comment)
- func (ai *ArrayItem) SetMeta(name string, data interface{})
- func (ai *ArrayItem) SetPosition(position *filepos.Position)
- func (ai *ArrayItem) SetValue(val interface{}) error
- type ArrayItemProto
- type ArrayProto
- type Comment
- type CommentProto
- type CommentSlice
- type DocSetOpts
- type Document
- func (d *Document) AddValue(val interface{}) error
- func (d *Document) AsInterface() interface{}
- func (d *Document) AsYAMLBytes() ([]byte, error)
- func (d *Document) DeepCopy() *Document
- func (d *Document) DeepCopyAsInterface() interface{}
- func (d *Document) DeepCopyAsNode() Node
- func (d *Document) GetAnnotations() interface{}
- func (d *Document) GetComments() []*Comment
- func (d *Document) GetMeta(name string) interface{}
- func (d *Document) GetPosition() *filepos.Position
- func (d *Document) GetValues() []interface{}
- func (d *Document) IsEmpty() bool
- func (d *Document) MarshalJSON() ([]byte, error)
- func (d *Document) MarshalYAML() (interface{}, error)
- func (d *Document) ResetValue()
- func (d *Document) SetAnnotations(anns interface{})
- func (d *Document) SetComments(c []*Comment)
- func (d *Document) SetMeta(name string, data interface{})
- func (d *Document) SetPosition(position *filepos.Position)
- func (d *Document) SetValue(val interface{}) error
- type DocumentPrinter
- type DocumentProto
- type DocumentSet
- func (ds *DocumentSet) AddValue(val interface{}) error
- func (ds *DocumentSet) AsBytes() ([]byte, error)
- func (ds *DocumentSet) AsBytesWithPrinter(printerFunc func(io.Writer) DocumentPrinter) ([]byte, error)
- func (ds *DocumentSet) AsSourceBytes() ([]byte, bool)
- func (ds *DocumentSet) DeepCopy() *DocumentSet
- func (ds *DocumentSet) DeepCopyAsInterface() interface{}
- func (ds *DocumentSet) DeepCopyAsNode() Node
- func (ds *DocumentSet) GetAnnotations() interface{}
- func (ds *DocumentSet) GetComments() []*Comment
- func (ds *DocumentSet) GetMeta(name string) interface{}
- func (ds *DocumentSet) GetPosition() *filepos.Position
- func (ds *DocumentSet) GetValues() []interface{}
- func (ds *DocumentSet) MarshalJSON() ([]byte, error)
- func (ds *DocumentSet) MarshalYAML() (interface{}, error)
- func (ds *DocumentSet) OverrideMapKeys()
- func (ds *DocumentSet) Print(writer io.Writer)
- func (ds *DocumentSet) ResetValue()
- func (ds *DocumentSet) SetAnnotations(anns interface{})
- func (ds *DocumentSet) SetComments(c []*Comment)
- func (ds *DocumentSet) SetMeta(name string, data interface{})
- func (ds *DocumentSet) SetPosition(position *filepos.Position)
- func (ds *DocumentSet) SetValue(val interface{}) error
- type DocumentSetProto
- type FilePositionPrinter
- type FilePositionPrinterOpts
- type JSONPrinter
- type Map
- func (m *Map) AddValue(val interface{}) error
- func (m *Map) DeepCopy() *Map
- func (m *Map) DeepCopyAsInterface() interface{}
- func (m *Map) DeepCopyAsNode() Node
- func (m *Map) GetAnnotations() interface{}
- func (m *Map) GetComments() []*Comment
- func (m *Map) GetMeta(name string) interface{}
- func (m *Map) GetPosition() *filepos.Position
- func (m *Map) GetValues() []interface{}
- func (m *Map) MarshalJSON() ([]byte, error)
- func (m *Map) MarshalYAML() (interface{}, error)
- func (m *Map) ResetValue()
- func (m *Map) SetAnnotations(anns interface{})
- func (m *Map) SetComments(c []*Comment)
- func (m *Map) SetMeta(name string, data interface{})
- func (m *Map) SetPosition(position *filepos.Position)
- func (m *Map) SetValue(val interface{}) error
- type MapItem
- func (mi *MapItem) AddValue(val interface{}) error
- func (mi *MapItem) DeepCopy() *MapItem
- func (mi *MapItem) DeepCopyAsInterface() interface{}
- func (mi *MapItem) DeepCopyAsNode() Node
- func (mi *MapItem) GetAnnotations() interface{}
- func (mi *MapItem) GetComments() []*Comment
- func (mi *MapItem) GetMeta(name string) interface{}
- func (mi *MapItem) GetPosition() *filepos.Position
- func (mi *MapItem) GetValues() []interface{}
- func (mi *MapItem) MarshalJSON() ([]byte, error)
- func (mi *MapItem) MarshalYAML() (interface{}, error)
- func (mi *MapItem) ResetValue()
- func (mi *MapItem) SetAnnotations(anns interface{})
- func (mi *MapItem) SetComments(c []*Comment)
- func (mi *MapItem) SetMeta(name string, data interface{})
- func (mi *MapItem) SetPosition(position *filepos.Position)
- func (mi *MapItem) SetValue(val interface{}) error
- type MapItemProto
- type MapProto
- type Node
- type Parser
- type ParserOpts
- type Printer
- type PrinterOpts
- type Visitor
- type VisitorWithParent
- type WrappedFilePositionPrinter
- type YAMLPrinter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewASTFromInterface ¶
func NewASTFromInterface(val interface{}) interface{}
func NewASTFromInterfaceWithNoPosition ¶ added in v0.48.0
func NewASTFromInterfaceWithNoPosition(val interface{}) interface{}
func NewASTFromInterfaceWithPosition ¶ added in v0.48.0
func NewGoFromAST ¶ added in v0.20.0
func NewGoFromAST(val interface{}) interface{}
func NewValue ¶ added in v0.48.0
func NewValue(val interface{}) interface{}
NewValue creates a new Document, Map, Array, or scalar, depending on the type of the given prototype
func PlainMarshal ¶
func PlainUnmarshal ¶
func TypeName ¶ added in v0.48.0
func TypeName(val interface{}) string
TypeName returns the user-friendly name of the type of `val`
func Walk ¶ added in v0.48.0
Walk traverses the tree starting at `n`, recursively, depth-first, invoking `v` on each node. if `v` returns non-nil error, the traversal is aborted.
func WalkWithParent ¶ added in v0.48.0
func WalkWithParent(node Node, parent Node, path string, v VisitorWithParent) error
WalkWithParent traverses the tree starting at `n`, recursively, depth-first, invoking `v` on each node and including
a reference to "node"s parent node as well.
if `v` returns non-nil error, the traversal is aborted.
Types ¶
type Array ¶
type Array struct { Comments []*Comment Items []*ArrayItem Position *filepos.Position // contains filtered or unexported fields }
func NewArray ¶ added in v0.48.0
func NewArray(val *ArrayProto) *Array
NewArray creates a new Array instance based on the given prototype
func (*Array) DeepCopyAsInterface ¶
func (a *Array) DeepCopyAsInterface() interface{}
func (*Array) DeepCopyAsNode ¶
func (*Array) GetAnnotations ¶
func (a *Array) GetAnnotations() interface{}
func (*Array) GetComments ¶ added in v0.48.0
func (*Array) GetMeta ¶ added in v0.48.0
GetMeta returns the metadata named `name` that was previously attached via SetMeta()
func (*Array) GetPosition ¶
func (*Array) MarshalJSON ¶ added in v0.15.0
MarshalJSON panics because Nodes cannot be marshalled directly.
func (*Array) MarshalYAML ¶
MarshalYAML panics because Nodes cannot be marshalled directly.
func (*Array) ResetValue ¶
func (a *Array) ResetValue()
func (*Array) SetAnnotations ¶
func (a *Array) SetAnnotations(anns interface{})
func (*Array) SetComments ¶ added in v0.48.0
SetComments replaces comments with "c"
func (*Array) SetMeta ¶ added in v0.48.0
SetMeta attaches metadata identified by `name` than can later be retrieved via GetMeta()
func (*Array) SetPosition ¶ added in v0.48.0
type ArrayItem ¶
type ArrayItem struct { Comments []*Comment Value interface{} Position *filepos.Position // contains filtered or unexported fields }
func NewArrayItem ¶ added in v0.48.0
func NewArrayItem(val *ArrayItemProto) *ArrayItem
NewArrayItem creates a new ArrayItem instance based on the given prototype
func (*ArrayItem) DeepCopyAsInterface ¶
func (ai *ArrayItem) DeepCopyAsInterface() interface{}
func (*ArrayItem) DeepCopyAsNode ¶
func (*ArrayItem) GetAnnotations ¶
func (ai *ArrayItem) GetAnnotations() interface{}
func (*ArrayItem) GetComments ¶ added in v0.48.0
func (*ArrayItem) GetMeta ¶ added in v0.48.0
GetMeta returns the metadata named `name` that was previously attached via SetMeta()
func (*ArrayItem) GetPosition ¶
func (*ArrayItem) MarshalJSON ¶ added in v0.15.0
MarshalJSON panics because Nodes cannot be marshalled directly.
func (*ArrayItem) MarshalYAML ¶
MarshalYAML panics because Nodes cannot be marshalled directly.
func (*ArrayItem) ResetValue ¶
func (ai *ArrayItem) ResetValue()
func (*ArrayItem) SetAnnotations ¶
func (ai *ArrayItem) SetAnnotations(anns interface{})
func (*ArrayItem) SetComments ¶ added in v0.48.0
SetComments replaces comments with "c"
func (*ArrayItem) SetMeta ¶ added in v0.48.0
SetMeta attaches metadata identified by `name` than can later be retrieved via GetMeta()
func (*ArrayItem) SetPosition ¶ added in v0.48.0
type ArrayItemProto ¶ added in v0.48.0
type ArrayItemProto struct { Value interface{} Comments []*CommentProto Position *filepos.Position }
ArrayItemProto is a prototype for an ArrayItem
type ArrayProto ¶ added in v0.48.0
type ArrayProto struct { Items []*ArrayItemProto Comments []*CommentProto Position *filepos.Position }
ArrayProto is a prototype for an Array
type Comment ¶ added in v0.48.0
func NewComment ¶ added in v0.48.0
func NewComment(val *CommentProto) *Comment
NewComment creates a new Comment based on the given prototype
func NewComments ¶ added in v0.48.0
func NewComments(val []*CommentProto) []*Comment
NewComments creates a new slice of Comment based on the given prototype
type CommentProto ¶ added in v0.48.0
CommentProto is a prototype for a Comment
type CommentSlice ¶ added in v0.48.0
type CommentSlice []*Comment
func (CommentSlice) DeepCopy ¶ added in v0.48.0
func (s CommentSlice) DeepCopy() CommentSlice
type DocSetOpts ¶ added in v0.4.0
type Document ¶
type Document struct { Comments []*Comment Value interface{} Position *filepos.Position // contains filtered or unexported fields }
func NewDocument ¶ added in v0.48.0
func NewDocument(val *DocumentProto) *Document
NewDocument creates a new Document instance based on the given prototype
func (*Document) AsInterface ¶
func (d *Document) AsInterface() interface{}
func (*Document) AsYAMLBytes ¶ added in v0.20.0
func (*Document) DeepCopyAsInterface ¶
func (d *Document) DeepCopyAsInterface() interface{}
func (*Document) DeepCopyAsNode ¶
func (*Document) GetAnnotations ¶
func (d *Document) GetAnnotations() interface{}
func (*Document) GetComments ¶ added in v0.48.0
func (*Document) GetMeta ¶ added in v0.48.0
GetMeta returns the metadata named `name` that was previously attached via SetMeta()
func (*Document) GetPosition ¶
func (*Document) MarshalJSON ¶ added in v0.15.0
MarshalJSON panics because Nodes cannot be marshalled directly.
func (*Document) MarshalYAML ¶
MarshalYAML panics because Nodes cannot be marshalled directly.
func (*Document) ResetValue ¶
func (d *Document) ResetValue()
func (*Document) SetAnnotations ¶
func (d *Document) SetAnnotations(anns interface{})
func (*Document) SetComments ¶ added in v0.48.0
SetComments replaces comments with "c"
func (*Document) SetMeta ¶ added in v0.48.0
SetMeta attaches metadata identified by `name` than can later be retrieved via GetMeta()
func (*Document) SetPosition ¶ added in v0.48.0
type DocumentPrinter ¶ added in v0.14.0
type DocumentProto ¶ added in v0.48.0
type DocumentProto struct { Value interface{} Comments []*CommentProto Position *filepos.Position }
DocumentProto is a prototype for a Document
type DocumentSet ¶
type DocumentSet struct { Comments []*Comment AllComments []*Comment Items []*Document Position *filepos.Position // contains filtered or unexported fields }
func NewDocumentSet ¶ added in v0.48.0
func NewDocumentSet(val *DocumentSetProto) *DocumentSet
NewDocumentSet creates a new DocumentSet instance based on the given prototype
func NewDocumentSetFromBytes ¶
func NewDocumentSetFromBytes(data []byte, opts DocSetOpts) (*DocumentSet, error)
func (*DocumentSet) AddValue ¶
func (ds *DocumentSet) AddValue(val interface{}) error
func (*DocumentSet) AsBytes ¶
func (ds *DocumentSet) AsBytes() ([]byte, error)
func (*DocumentSet) AsBytesWithPrinter ¶ added in v0.14.0
func (ds *DocumentSet) AsBytesWithPrinter(printerFunc func(io.Writer) DocumentPrinter) ([]byte, error)
func (*DocumentSet) AsSourceBytes ¶
func (ds *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 (ds *DocumentSet) DeepCopy() *DocumentSet
func (*DocumentSet) DeepCopyAsInterface ¶
func (ds *DocumentSet) DeepCopyAsInterface() interface{}
func (*DocumentSet) DeepCopyAsNode ¶
func (ds *DocumentSet) DeepCopyAsNode() Node
func (*DocumentSet) GetAnnotations ¶
func (ds *DocumentSet) GetAnnotations() interface{}
func (*DocumentSet) GetComments ¶ added in v0.48.0
func (ds *DocumentSet) GetComments() []*Comment
func (*DocumentSet) GetMeta ¶ added in v0.48.0
func (ds *DocumentSet) GetMeta(name string) interface{}
GetMeta returns the metadata named `name` that was previously attached via SetMeta()
func (*DocumentSet) GetPosition ¶
func (ds *DocumentSet) GetPosition() *filepos.Position
func (*DocumentSet) GetValues ¶
func (ds *DocumentSet) GetValues() []interface{}
func (*DocumentSet) MarshalJSON ¶ added in v0.15.0
func (ds *DocumentSet) MarshalJSON() ([]byte, error)
MarshalJSON panics because Nodes cannot be marshalled directly.
func (*DocumentSet) MarshalYAML ¶
func (ds *DocumentSet) MarshalYAML() (interface{}, error)
MarshalYAML panics because Nodes cannot be marshalled directly.
func (*DocumentSet) OverrideMapKeys ¶ added in v0.48.0
func (ds *DocumentSet) OverrideMapKeys()
OverrideMapKeys within any contained Map, where there is more than one MapItem with the same key, delete all but the last.
func (*DocumentSet) Print ¶
func (ds *DocumentSet) Print(writer io.Writer)
func (*DocumentSet) ResetValue ¶
func (ds *DocumentSet) ResetValue()
func (*DocumentSet) SetAnnotations ¶
func (ds *DocumentSet) SetAnnotations(anns interface{})
func (*DocumentSet) SetComments ¶ added in v0.48.0
func (ds *DocumentSet) SetComments(c []*Comment)
SetComments replaces comments with "c"
func (*DocumentSet) SetMeta ¶ added in v0.48.0
func (ds *DocumentSet) SetMeta(name string, data interface{})
SetMeta attaches metadata identified by `name` than can later be retrieved via GetMeta()
func (*DocumentSet) SetPosition ¶ added in v0.48.0
func (ds *DocumentSet) SetPosition(position *filepos.Position)
func (*DocumentSet) SetValue ¶
func (ds *DocumentSet) SetValue(val interface{}) error
type DocumentSetProto ¶ added in v0.48.0
type DocumentSetProto struct { Items []*DocumentProto Comments []*CommentProto Position *filepos.Position }
DocumentSetProto is a prototype for a DocumentSet
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 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 { Comments []*Comment Items []*MapItem Position *filepos.Position // contains filtered or unexported fields }
func (*Map) DeepCopyAsInterface ¶
func (m *Map) DeepCopyAsInterface() interface{}
func (*Map) DeepCopyAsNode ¶
func (*Map) GetAnnotations ¶
func (m *Map) GetAnnotations() interface{}
func (*Map) GetComments ¶ added in v0.48.0
func (*Map) GetMeta ¶ added in v0.48.0
GetMeta returns the metadata named `name` that was previously attached via SetMeta()
func (*Map) GetPosition ¶
func (*Map) MarshalJSON ¶ added in v0.15.0
MarshalJSON panics because Nodes cannot be marshalled directly.
func (*Map) MarshalYAML ¶
MarshalYAML panics because Nodes cannot be marshalled directly.
func (*Map) ResetValue ¶
func (m *Map) ResetValue()
func (*Map) SetAnnotations ¶
func (m *Map) SetAnnotations(anns interface{})
func (*Map) SetComments ¶ added in v0.48.0
SetComments replaces comments with "c"
func (*Map) SetMeta ¶ added in v0.48.0
SetMeta attaches metadata identified by `name` than can later be retrieved via GetMeta()
func (*Map) SetPosition ¶ added in v0.48.0
type MapItem ¶
type MapItem struct { Comments []*Comment Key interface{} Value interface{} Position *filepos.Position // contains filtered or unexported fields }
func NewMapItem ¶ added in v0.48.0
func NewMapItem(val *MapItemProto) *MapItem
NewMapItem creates a new MapItem instance based on the given prototype
func (*MapItem) DeepCopyAsInterface ¶
func (mi *MapItem) DeepCopyAsInterface() interface{}
func (*MapItem) DeepCopyAsNode ¶
func (*MapItem) GetAnnotations ¶
func (mi *MapItem) GetAnnotations() interface{}
func (*MapItem) GetComments ¶ added in v0.48.0
func (*MapItem) GetMeta ¶ added in v0.48.0
GetMeta returns the metadata named `name` that was previously attached via SetMeta()
func (*MapItem) GetPosition ¶
func (*MapItem) MarshalJSON ¶ added in v0.15.0
MarshalJSON panics because Nodes cannot be marshalled directly.
func (*MapItem) MarshalYAML ¶
MarshalYAML panics because Nodes cannot be marshalled directly.
func (*MapItem) ResetValue ¶
func (mi *MapItem) ResetValue()
func (*MapItem) SetAnnotations ¶
func (mi *MapItem) SetAnnotations(anns interface{})
func (*MapItem) SetComments ¶ added in v0.48.0
SetComments replaces comments with "c"
func (*MapItem) SetMeta ¶ added in v0.48.0
SetMeta attaches metadata identified by `name` than can later be retrieved via GetMeta()
func (*MapItem) SetPosition ¶ added in v0.48.0
type MapItemProto ¶ added in v0.48.0
type MapItemProto struct { Key interface{} Value interface{} Comments []*CommentProto Position *filepos.Position }
MapItemProto is a prototype for a MapItem
type MapProto ¶ added in v0.48.0
type MapProto struct { Items []*MapItemProto Comments []*CommentProto Position *filepos.Position }
MapProto is a prototype for a Map
type Node ¶
type Node interface { GetPosition() *filepos.Position SetPosition(*filepos.Position) GetValues() []interface{} // ie children SetValue(interface{}) error AddValue(interface{}) error ResetValue() GetComments() []*Comment SetComments([]*Comment) GetMeta(name string) interface{} SetMeta(name string, data interface{}) GetAnnotations() interface{} SetAnnotations(interface{}) DeepCopyAsInterface() interface{} DeepCopyAsNode() Node // contains filtered or unexported methods }
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
func NewParser ¶
func NewParser(opts ParserOpts) *Parser
func (*Parser) ParseBytes ¶
func (p *Parser) ParseBytes(data []byte, associatedName string) (*DocumentSet, error)
type ParserOpts ¶ added in v0.17.0
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 Visitor ¶ added in v0.48.0
Visitor performs an operation on the given Node while traversing the AST. Typically defines the action taken during a Walk().
type VisitorWithParent ¶ added in v0.48.0
VisitorWithParent performs an operation on the given Node while traversing the AST, including a reference to "node"'s
parent node.
Typically defines the action taken during a WalkWithParent().
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