keyfile

package
v0.0.0-...-17244d7 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2024 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var LineBreak = "\n"

Functions

This section is empty.

Types

type BlankSectionNameError

type BlankSectionNameError struct{}

func (BlankSectionNameError) Error

func (err BlankSectionNameError) Error() string

type EntryNotInSectionError

type EntryNotInSectionError struct {
	Line string
}

func (EntryNotInSectionError) Error

func (err EntryNotInSectionError) Error() string

type InvalidKeyError

type InvalidKeyError struct {
	Key string
}

func (InvalidKeyError) Error

func (err InvalidKeyError) Error() string

type InvalidValueError

type InvalidValueError struct {
	Value string
}

func (InvalidValueError) Error

func (err InvalidValueError) Error() string

type KeyFile

type KeyFile struct {
	ListSeparator byte
	// contains filtered or unexported fields
}

func NewKeyFile

func NewKeyFile() *KeyFile

func (*KeyFile) DeleteKey

func (f *KeyFile) DeleteKey(section, key string) bool

func (*KeyFile) DeleteSection

func (f *KeyFile) DeleteSection(section string) bool

It returns true if the section was deleted, and false if the section didn't exist

func (*KeyFile) GetBool

func (f *KeyFile) GetBool(section, key string) (bool, error)

func (*KeyFile) GetBoolList

func (f *KeyFile) GetBoolList(section, key string) ([]bool, error)

func (*KeyFile) GetFloat64

func (f *KeyFile) GetFloat64(section, key string) (float64, error)

func (*KeyFile) GetFloat64List

func (f *KeyFile) GetFloat64List(section, key string) ([]float64, error)

func (*KeyFile) GetInt

func (f *KeyFile) GetInt(section, key string) (int, error)

func (*KeyFile) GetInt64

func (f *KeyFile) GetInt64(section, key string) (int64, error)

func (*KeyFile) GetIntList

func (f *KeyFile) GetIntList(section, key string) ([]int, error)

func (*KeyFile) GetKeyComments

func (f *KeyFile) GetKeyComments(section, key string) string

func (*KeyFile) GetKeys

func (f *KeyFile) GetKeys(section string) []string

func (*KeyFile) GetLocaleString

func (f *KeyFile) GetLocaleString(section, key, locale string) (string, error)

func (*KeyFile) GetLocaleStringList

func (f *KeyFile) GetLocaleStringList(section, key, locale string) ([]string, error)

func (*KeyFile) GetSection

func (f *KeyFile) GetSection(section string) (map[string]string, error)

func (*KeyFile) GetSectionComments

func (f *KeyFile) GetSectionComments(section string) string

func (*KeyFile) GetSections

func (f *KeyFile) GetSections() []string

func (*KeyFile) GetString

func (f *KeyFile) GetString(section, key string) (string, error)

func (*KeyFile) GetStringList

func (f *KeyFile) GetStringList(section, key string) ([]string, error)

func (*KeyFile) GetUint64

func (f *KeyFile) GetUint64(section, key string) (uint64, error)

func (*KeyFile) GetValue

func (f *KeyFile) GetValue(section, key string) (string, error)

func (*KeyFile) LoadFromData

func (f *KeyFile) LoadFromData(data []byte) error

func (*KeyFile) LoadFromFile

func (f *KeyFile) LoadFromFile(filename string) error

func (*KeyFile) LoadFromReader

func (f *KeyFile) LoadFromReader(reader io.Reader) error

func (*KeyFile) SaveToFile

func (kf *KeyFile) SaveToFile(file string) error

func (*KeyFile) SaveToWriter

func (f *KeyFile) SaveToWriter(w io.Writer) error

func (*KeyFile) SetBool

func (f *KeyFile) SetBool(section, key string, value bool)

func (*KeyFile) SetBoolList

func (f *KeyFile) SetBoolList(section, key string, values []bool)

func (*KeyFile) SetFloat64

func (f *KeyFile) SetFloat64(section, key string, value float64)

func (*KeyFile) SetFloat64List

func (f *KeyFile) SetFloat64List(section, key string, values []float64)

func (*KeyFile) SetInt

func (f *KeyFile) SetInt(section, key string, value int)

func (*KeyFile) SetInt64

func (f *KeyFile) SetInt64(section, key string, value int64)

func (*KeyFile) SetIntList

func (f *KeyFile) SetIntList(section, key string, values []int)

func (*KeyFile) SetKeyComments

func (f *KeyFile) SetKeyComments(section, key, comments string) bool

func (*KeyFile) SetSectionComments

func (f *KeyFile) SetSectionComments(section, comments string) bool

func (*KeyFile) SetString

func (f *KeyFile) SetString(section, key, value string)

func (*KeyFile) SetStringList

func (f *KeyFile) SetStringList(section, key string, values []string)

func (*KeyFile) SetUint64

func (f *KeyFile) SetUint64(section, key string, value uint64)

func (*KeyFile) SetValue

func (f *KeyFile) SetValue(section, key, value string) bool

it returns true if the key and value were inserted or return false if the value was overwritten.

type KeyNotFoundError

type KeyNotFoundError struct {
	Name string
}

func (KeyNotFoundError) Error

func (err KeyNotFoundError) Error() string

type ParseError

type ParseError struct {
	Line string
}

func (ParseError) Error

func (err ParseError) Error() string

type SectionNotFoundError

type SectionNotFoundError struct {
	Name string
}

func (SectionNotFoundError) Error

func (err SectionNotFoundError) Error() string

type ValueInvalidUTF8Error

type ValueInvalidUTF8Error struct {
	Section string
	Key     string
}

func (ValueInvalidUTF8Error) Error

func (err ValueInvalidUTF8Error) Error() string

Jump to

Keyboard shortcuts

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