Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LiteralValue ¶ added in v1.5.0
type LiteralValue struct { // Value is the actual value to be written // // for example: // yw := NewWriter(nil) // yw.WriteTagValue("foo", LiteralValue{Value: "[]"}) // would result in yaml: // foo: [] Value string // SafeEncodeString if set to true, indicates that the Value is an actual string value and should be safely yanl encoded accordingly SafeEncodeString bool }
LiteralValue enables unadulterated values to be written to yaml
type RefChecker ¶ added in v1.8.3
RefChecker is an interface optionally used by Writer.RefChecker so that refs can be checked for existence
type Writer ¶
type Writer interface { Flush() error Bytes() ([]byte, error) WriteTagValue(name string, value any) Writer WriteTagStart(name string) Writer WriteTagEnd() Writer WritePathStart(context string, path string) Writer WriteItem(value any) Writer WriteItemValue(name string, value any) Writer WriteItemStart(name string, value any) Writer // WriteLines writes the provided lines (current indent is added to each line) WriteLines(lines ...string) Writer // Write writes the provided data (no indent is added - and data must include indents!) Write(data []byte) Writer WriteComments(lines ...string) Writer CurrentIndent() string SetError(err error) Errored() error RefChecker(rc RefChecker) RefChecker }
Click to show internal directories.
Click to hide internal directories.