Documentation
¶
Overview ¶
Package ini implements an opinionated ini parser that only implements what we exactly need for WireGuard configs - key/values MUST live under a section - empty section names are NOT allowed - comments are indicated with a #
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type INI ¶
type INI struct {
// contains filtered or unexported fields
}
INI is the struct for a ini file
func (*INI) AddSection ¶
AddSection adds a section with name `name` and returns an error if the section already exists
type OrderedKeys ¶
type OrderedKeys []string
OrderedKeys is a slice of strings that is used for an ordered map
func (*OrderedKeys) Remove ¶
func (ok *OrderedKeys) Remove(name string)
Remove removes a `name` from the OrderedKeys slice by finding the name It is a no-op if the key does not exist
type Section ¶
type Section struct {
// contains filtered or unexported fields
}
Section represents a single section within an ini file It consists of multiple key and values
func (*Section) AddKeyValue ¶
AddKeyValue adds a new key `key` with value `value` It returns an error if the key already exists
func (*Section) AddOrReplaceKeyValue ¶
AddOrReplaceKeyValue adds a key `key` with value `value` If the key already exists it modifies the value