internal

package
v0.0.0-...-9e081f2 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsValidName

func IsValidName(name string) bool

func SaveFile

func SaveFile(name string, root tree.Element) (int, error)

func Serialize

func Serialize(root tree.Element, w io.Writer) (written int, err error)

Types

type Conf

type Conf struct {
	RootNode tree.NodeElement
	Sections map[string]*Section
	// contains filtered or unexported fields
}

func NewConf

func NewConf(root tree.NodeElement) *Conf

func Parse

func Parse(name string, src *[]byte) (*Conf, error)

func ParseFile

func ParseFile(name string) (*Conf, error)

func (*Conf) AddSection

func (c *Conf) AddSection(name string) *Section

func (*Conf) AddSectionNode

func (c *Conf) AddSectionNode(n tree.NodeElement) *Section

func (*Conf) RemoveEntry

func (c *Conf) RemoveEntry(name string)

func (*Conf) RemoveSection

func (c *Conf) RemoveSection(name string)

func (*Conf) SetEntry

func (c *Conf) SetEntry(name, value string)

func (*Conf) Updated

func (c *Conf) Updated() bool

type Entry

type Entry struct {
	Node      tree.NodeElement
	ValueNode tree.Element
	Value     string
}

type Section

type Section struct {
	Nodes   []tree.NodeElement
	Entries map[string]*Entry
	Updated bool
}

func (*Section) AddEntryNode

func (s *Section) AddEntryNode(n tree.NodeElement) *Entry

func (*Section) RemoveEntry

func (s *Section) RemoveEntry(name string)

func (*Section) SetEntry

func (s *Section) SetEntry(name, value string) *Entry

Jump to

Keyboard shortcuts

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