Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Marshal ¶
func Marshal[T comparable](root NodeMarshaler[T]) ([]byte, error)
func Stringify ¶
func Stringify[T comparable](node Node[T], options *Options) string
Stringify converts node to string
func Unmarshal ¶
func Unmarshal[T comparable](root NodeUnmarshaler[T], data []byte) error
Types ¶
type Node ¶
type Node[T comparable] interface { String() string // String returns node self information Parent() T // Parent returns parent node or nil NumChild() int // NumChild returns number of child GetChildByIndex(i int) T // GetChildByIndex gets child by index }
Node represents a generic printable node
type NodeMarshalUnmarshaler ¶
type NodeMarshaler ¶
type NodeMarshaler[T comparable] interface { Node[T] Marshal() ([]byte, error) }
type NodeUnmarshaler ¶
type NodeUnmarshaler[T comparable] interface { Node[T] Unmarshal(data []byte) error }
Click to show internal directories.
Click to hide internal directories.