ini

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 23, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package ini provides an INI format handler for chezmoi-split.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler struct{}

Handler implements format.Handler for INI files.

func New

func New() *Handler

New creates a new INI handler.

func (*Handler) GetPath

func (h *Handler) GetPath(tree any, p path.Path) (any, bool)

GetPath extracts a value at the given path, supporting wildcards. INI paths are limited to ["section", "key"] format (max 2 segments). Wildcard "*" can be used for section to match any section.

func (*Handler) Parse

func (h *Handler) Parse(data []byte, opts format.ParseOptions) (any, error)

Parse reads INI bytes and returns an *orderedmap.OrderedMap. Structure: {"section": {"key": "value"}} Global keys (before any section) are stored under the empty string key "".

func (*Handler) Serialize

func (h *Handler) Serialize(tree any, opts format.SerializeOptions) ([]byte, error)

Serialize writes the tree to formatted INI bytes.

func (*Handler) SetPath

func (h *Handler) SetPath(tree any, p path.Path, value any) error

SetPath sets a value at the given path, supporting wildcards. INI paths are limited to ["section", "key"] format (max 2 segments). Values are converted to strings (INI only supports strings).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址