ini

package
v0.0.0-...-ba0b20d Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2026 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Entries  []*Entry
	Sections map[string]*Section
}

func NewConfig

func NewConfig() *Config

func Parse

func Parse(r io.Reader) (*Config, error)

func ParseFile

func ParseFile(filepath string) (*Config, error)

func (*Config) Delete

func (c *Config) Delete(section, key string) bool

func (*Config) ForEachKey

func (c *Config) ForEachKey(section string, fn func(key, value string))

func (*Config) Get

func (c *Config) Get(section, key string) (string, bool)

func (*Config) Move

func (c *Config) Move(section, key string, newIndex int) bool

func (*Config) Set

func (c *Config) Set(section, key, value string)

func (*Config) Write

func (c *Config) Write(w io.Writer) error

type Entry

type Entry struct {
	Type      EntryType
	Section   string
	Key       string
	Value     string
	Raw       string
	Multiline bool
	Lines     []string
}

type EntryType

type EntryType uint8
const (
	EntryBlank EntryType = iota
	EntryComment
	EntrySection
	EntryKeyValue
)

type Section

type Section struct {
	Name    string
	Entries []*Entry
}

Jump to

Keyboard shortcuts

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