Versions in this module Expand all Collapse all v1 v1.0.3 Jul 26, 2026 v1.0.2 Jul 26, 2026 v1.0.1 Jul 25, 2026 v1.0.0 Jul 25, 2026 Changes in this version + var Base64Format = &Format + var CSVFormat = &Format + var ConfiguredCsvPreferences = NewDefaultCsvPreferences() + var ConfiguredHclPreferences = NewDefaultHclPreferences() + var ConfiguredINIPreferences = NewDefaultINIPreferences() + var ConfiguredJSONPreferences = NewDefaultJsonPreferences() + var ConfiguredKYamlPreferences = NewDefaultKYamlPreferences() + var ConfiguredLuaPreferences = NewDefaultLuaPreferences() + var ConfiguredPropertiesPreferences = NewDefaultPropertiesPreferences() + var ConfiguredSecurityPreferences = SecurityPreferences + var ConfiguredShellVariablesPreferences = NewDefaultShellVariablesPreferences() + var ConfiguredTomlPreferences = NewDefaultTomlPreferences() + var ConfiguredTsvPreferences = NewDefaultTsvPreferences() + var ConfiguredXMLPreferences = NewDefaultXmlPreferences() + var ConfiguredYamlPreferences = NewDefaultYamlPreferences() + var Formats = []*Format + var HclFormat = &Format + var INIFormat = &Format + var JSONFormat = &Format + var KYamlFormat = &Format + var LoadYamlPreferences = YamlPreferences + var LuaFormat = &Format + var Now = time.Now + var PrettyPrintExp = `(... | (select(tag != "!!str"), select(tag == "!!str") | select(test("(?i)^(y|yes|n|no|on|off)$") | not)) ) style=""` + var PropertiesFormat = &Format + var ShFormat = &Format + var ShellVariablesFormat = &Format + var StringInterpolationEnabled = true + var TSVFormat = &Format + var TomlFormat = &Format + var UriFormat = &Format + var XMLFormat = &Format + var YamlFormat = &Format + func ClearFilenameAliases() + func FormatStringFromFilename(filename string) string + func GetAvailableInputFormatString() string + func GetAvailableOutputFormatString() string + func InitExpressionParser() + func KindString(kind Kind) string + func MapToYamlStyle(original Style) yaml.Style + func NewFrontMatterHandler(originalFilename string) frontMatterHandler + func NewWriteInPlaceHandler(inputFile string) writeInPlaceHandler + func NodeContentToString(node *CandidateNode, depth int) string + func NodeToString(node *CandidateNode) string + func NodesToString(collection *list.List) string + func PrintYAMLDocumentSeparator(writer io.Writer, PrintDocSeparators bool) error + func PrintYAMLLeadingContent(writer io.Writer, content string, PrintDocSeparators bool, ColorsEnabled bool) error + func ReadDocuments(reader io.Reader, decoder Decoder) (*list.List, error) + func SafelyCloseReader(reader io.Reader) + func SetFilenameAlias(realPath string, displayName string) + type CandidateNode struct + Alias *CandidateNode + Anchor string + Column int + Content []*CandidateNode + EncodeHint EncodeHint + EvaluateTogether bool + FootComment string + HeadComment string + IsMapKey bool + Key *CandidateNode + Kind Kind + LeadingContent string + Line int + LineComment string + Parent *CandidateNode + Style Style + Tag string + Value string + func (n *CandidateNode) AddChild(rawChild *CandidateNode) + func (n *CandidateNode) AddChildren(children []*CandidateNode) + func (n *CandidateNode) AddKeyValueChild(rawKey *CandidateNode, rawValue *CandidateNode) (*CandidateNode, *CandidateNode) + func (n *CandidateNode) AsList() *list.List + func (n *CandidateNode) CanVisitValues() bool + func (n *CandidateNode) ConvertToNodeInfo() *NodeInfo + func (n *CandidateNode) Copy() *CandidateNode + func (n *CandidateNode) CopyAsReplacement(replacement *CandidateNode) *CandidateNode + func (n *CandidateNode) CopyWithoutContent() *CandidateNode + func (n *CandidateNode) CreateChild() *CandidateNode + func (n *CandidateNode) CreateReplacement(kind Kind, tag string, value string) *CandidateNode + func (n *CandidateNode) CreateReplacementWithComments(kind Kind, tag string, style Style) *CandidateNode + func (n *CandidateNode) FilterMapContentByKey(keyPredicate func(*CandidateNode) bool) []*CandidateNode + func (n *CandidateNode) GetDocument() uint + func (n *CandidateNode) GetFileIndex() int + func (n *CandidateNode) GetFilename() string + func (n *CandidateNode) GetKey() string + func (n *CandidateNode) GetNicePath() string + func (n *CandidateNode) GetPath() []interface{} + func (n *CandidateNode) GetValueRep() (interface{}, error) + func (n *CandidateNode) SetDocument(idx uint) + func (n *CandidateNode) SetFileIndex(idx int) + func (n *CandidateNode) SetFilename(name string) + func (n *CandidateNode) SetParent(parent *CandidateNode) + func (n *CandidateNode) UpdateAttributesFrom(other *CandidateNode, prefs assignPreferences) + func (n *CandidateNode) UpdateFrom(other *CandidateNode, prefs assignPreferences) + func (n *CandidateNode) VisitValues(visitor ValueVisitor) error + func (o *CandidateNode) MarshalJSON() ([]byte, error) + func (o *CandidateNode) MarshalYAML() (*yaml.Node, error) + func (o *CandidateNode) UnmarshalGoccyYAML(node ast.Node, cm yaml.CommentMap, anchorMap map[string]*CandidateNode) error + func (o *CandidateNode) UnmarshalJSON(data []byte) error + func (o *CandidateNode) UnmarshalYAML(node *yaml.Node, anchorMap map[string]*CandidateNode) error + type Context struct + DontAutoCreate bool + MatchingNodes *list.List + Variables map[string]*list.List + func (n *Context) ChildContext(results *list.List) Context + func (n *Context) Clone() Context + func (n *Context) DeepClone() Context + func (n *Context) GetDateTimeLayout() string + func (n *Context) GetVariable(name string) *list.List + func (n *Context) ReadOnlyClone() Context + func (n *Context) SetDateTimeLayout(newDateTimeLayout string) + func (n *Context) SetVariable(name string, value *list.List) + func (n *Context) SingleChildContext(candidate *CandidateNode) Context + func (n *Context) SingleReadonlyChildContext(candidate *CandidateNode) Context + func (n *Context) ToString() string + func (n *Context) WritableClone() Context + type CsvPreferences struct + AutoParse bool + Separator rune + func NewDefaultCsvPreferences() CsvPreferences + func NewDefaultTsvPreferences() CsvPreferences + type DataTreeNavigator interface + DeeplyAssign func(context Context, path []interface{}, rhsNode *CandidateNode) error + GetMatchingNodes func(context Context, expressionNode *ExpressionNode) (Context, error) + func NewDataTreeNavigator() DataTreeNavigator + type Decoder interface + Decode func() (*CandidateNode, error) + Init func(reader io.Reader) error + func NewBase64Decoder() Decoder + func NewCSVObjectDecoder(prefs CsvPreferences) Decoder + func NewGoccyYAMLDecoder() Decoder + func NewHclDecoder() Decoder + func NewINIDecoder(prefs INIPreferences) Decoder + func NewJSONDecoder() Decoder + func NewLuaDecoder(prefs LuaPreferences) Decoder + func NewPropertiesDecoder() Decoder + func NewTomlDecoder() Decoder + func NewUriDecoder() Decoder + func NewXMLDecoder(prefs XmlPreferences) Decoder + func NewYamlDecoder(prefs YamlPreferences) Decoder + type DecoderFactoryFunction func() Decoder + type EncodeHint int + const EncodeHintDefault + const EncodeHintInline + const EncodeHintSeparateBlock + type Encoder interface + CanHandleAliases func() bool + Encode func(writer io.Writer, node *CandidateNode) error + PrintDocumentSeparator func(writer io.Writer) error + PrintLeadingContent func(writer io.Writer, content string) error + func NewBase64Encoder() Encoder + func NewCsvEncoder(prefs CsvPreferences) Encoder + func NewHclEncoder(prefs HclPreferences) Encoder + func NewINIEncoder() Encoder + func NewJSONEncoder(prefs JsonPreferences) Encoder + func NewKYamlEncoder(prefs KYamlPreferences) Encoder + func NewLuaEncoder(prefs LuaPreferences) Encoder + func NewPropertiesEncoder(prefs PropertiesPreferences) Encoder + func NewShEncoder() Encoder + func NewShellVariablesEncoder() Encoder + func NewTomlEncoder() Encoder + func NewTomlEncoderWithPrefs(prefs TomlPreferences) Encoder + func NewUriEncoder() Encoder + func NewXMLEncoder(prefs XmlPreferences) Encoder + func NewYamlEncoder(prefs YamlPreferences) Encoder + type EncoderFactoryFunction func() Encoder + type Evaluator interface + EvaluateCandidateNodes func(expression string, inputCandidateNodes *list.List) (*list.List, error) + EvaluateFiles func(expression string, filenames []string, printer Printer, decoder Decoder) error + EvaluateNodes func(expression string, nodes ...*CandidateNode) (*list.List, error) + func NewAllAtOnceEvaluator() Evaluator + type ExpressionNode struct + LHS *ExpressionNode + Operation *Operation + Parent *ExpressionNode + RHS *ExpressionNode + type ExpressionParserInterface interface + ParseExpression func(expression string) (*ExpressionNode, error) + var ExpressionParser ExpressionParserInterface + type Format struct + DecoderFactory DecoderFactoryFunction + EncoderFactory EncoderFactoryFunction + FormalName string + Names []string + func FormatFromString(format string) (*Format, error) + func GetAvailableInputFormats() []*Format + func GetAvailableOutputFormats() []*Format + func (f *Format) GetConfiguredEncoder() Encoder + func (f *Format) MatchesName(name string) bool + type HclPreferences struct + ColorsEnabled bool + func NewDefaultHclPreferences() HclPreferences + func (p *HclPreferences) Copy() HclPreferences + type INIPreferences struct + ColorsEnabled bool + PreserveSurroundedQuote bool + func NewDefaultINIPreferences() INIPreferences + func (p *INIPreferences) Copy() INIPreferences + type JsonPreferences struct + ColorsEnabled bool + Indent int + UnwrapScalar bool + func NewDefaultJsonPreferences() JsonPreferences + func (p *JsonPreferences) Copy() JsonPreferences + type KYamlPreferences struct + ColorsEnabled bool + Indent int + PrintDocSeparators bool + UnwrapScalar bool + func NewDefaultKYamlPreferences() KYamlPreferences + func (p *KYamlPreferences) Copy() KYamlPreferences + type Kind uint32 + const AliasNode + const MappingNode + const ScalarNode + const SequenceNode + type Logger struct + func GetLogger() *Logger + func (l *Logger) Debug(msg string) + func (l *Logger) Debugf(format string, args ...interface{}) + func (l *Logger) Error(msg string) + func (l *Logger) Errorf(format string, args ...interface{}) + func (l *Logger) GetLevel() slog.Level + func (l *Logger) Info(msg string) + func (l *Logger) Infof(format string, args ...interface{}) + func (l *Logger) IsEnabledFor(level slog.Level) bool + func (l *Logger) SetLevel(level slog.Level) + func (l *Logger) SetSlogger(logger *slog.Logger) + func (l *Logger) Warning(msg string) + func (l *Logger) Warningf(format string, args ...interface{}) + type LuaPreferences struct + DocPrefix string + DocSuffix string + Globals bool + UnquotedKeys bool + func NewDefaultLuaPreferences() LuaPreferences + type NodeInfo struct + Anchor string + Column int + Content []*NodeInfo + FootComment string + HeadComment string + Kind string + Line int + LineComment string + Style string + Tag string + Value string + type Operation struct + CandidateNode *CandidateNode + OperationType *operationType + Preferences interface{} + StringValue string + UpdateAssign bool + Value interface{} + type Printer interface + PrintResults func(matchingNodes *list.List) error + PrintedAnything func() bool + SetAppendix func(reader io.Reader) + SetNulSepOutput func(nulSepOutput bool) + func NewNodeInfoPrinter(printerWriter PrinterWriter) Printer + func NewPrinter(encoder Encoder, printerWriter PrinterWriter) Printer + type PrinterWriter interface + GetWriter func(node *CandidateNode) (*bufio.Writer, error) + func NewMultiPrinterWriter(expression *ExpressionNode, format *Format) PrinterWriter + func NewSinglePrinterWriter(writer io.Writer) PrinterWriter + type PropertiesPreferences struct + KeyValueSeparator string + UnwrapScalar bool + UseArrayBrackets bool + func NewDefaultPropertiesPreferences() PropertiesPreferences + func (p *PropertiesPreferences) Copy() PropertiesPreferences + type SecurityPreferences struct + DisableEnvOps bool + DisableFileOps bool + EnableSystemOps bool + type ShellVariablesPreferences struct + KeySeparator string + UnwrapScalar bool + func NewDefaultShellVariablesPreferences() ShellVariablesPreferences + type StreamEvaluator interface + Evaluate func(filename string, reader io.Reader, node *ExpressionNode, printer Printer, ...) (uint, error) + EvaluateFiles func(expression string, filenames []string, printer Printer, decoder Decoder) error + EvaluateNew func(expression string, printer Printer) error + func NewStreamEvaluator() StreamEvaluator + type StringEvaluator interface + Evaluate func(expression string, input string, encoder Encoder, decoder Decoder) (string, error) + EvaluateAll func(expression string, input string, encoder Encoder, decoder Decoder) (string, error) + func NewStringEvaluator() StringEvaluator + type Style uint32 + const DoubleQuotedStyle + const FlowStyle + const FoldedStyle + const LiteralStyle + const SingleQuotedStyle + const TaggedStyle + func MapYamlStyle(original yaml.Style) Style + type TomlPreferences struct + ColorsEnabled bool + func NewDefaultTomlPreferences() TomlPreferences + func (p *TomlPreferences) Copy() TomlPreferences + type ValueVisitor func(*CandidateNode) error + type XmlPreferences struct + AttributePrefix string + ContentName string + DirectiveName string + Indent int + KeepNamespace bool + ProcInstPrefix string + SkipDirectives bool + SkipProcInst bool + StrictMode bool + UseRawToken bool + func NewDefaultXmlPreferences() XmlPreferences + func (p *XmlPreferences) Copy() XmlPreferences + type YamlPreferences struct + ColorsEnabled bool + CompactSequenceIndent bool + EvaluateTogether bool + FixMergeAnchorToSpec bool + Indent int + LeadingContentPreProcessing bool + PrintDocSeparators bool + UnwrapScalar bool + func NewDefaultYamlPreferences() YamlPreferences + func (p *YamlPreferences) Copy() YamlPreferences