Documentation ¶
Overview ¶
Package ini provides a simple package to read/write/manipulate ini files.
Mainly a frontend to http://github.com/knq/ini/parser
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GitSectionManipFunc ¶
GitSectionManipFunc is a helper method to manipulate sections in ini files in a Gitconfig compatible way and provides subsection functionality.
Use it by setting File.SectionManipFunc.
Example:
f := ini.LoadString(`...`) f.SectionManipFunc = ini.GitSectionManipFunc f.SectionNameFunc = ini.GitSectionNameFunc
func GitSectionNameFunc ¶
GitSectionNameFunc is a helper method to manipulate section names in ini files in a Gitconfig compatible way and provides subsection functionality.
Effectively inverse of GitSectionManipFunc.
Use this by setting File.SectionNameFunc.
Example:
f := ini.LoadString(`...`) f.SectionManipFunc = ini.GitSectionManipFunc f.SectionNameFunc = ini.GitSectionNameFunc
Types ¶
type Error ¶
type Error string
Error is a ini error.
const (
ErrNoFilenameSupplied Error = "no filename supplied"
)
Error values.
type File ¶
File wraps parser.File with information about an ini file.
File can be written to disk by calling File.Save.
func LoadFile ¶
LoadFile loads ini data from a file with specified filename.
If the filename doesn't exist, then an empty File is returned. The data can then be written to disk using File.Save, or parser.File.Write.
type ParseError ¶
type ParseError struct {
// contains filtered or unexported fields
}
ParseError is a ini parse error.
func (*ParseError) Error ¶
func (err *ParseError) Error() string
Error satisfies the error interface.
Directories ¶
Path | Synopsis |
---|---|
_examples
|
|
simple
_examples/simple/main.go
|
_examples/simple/main.go |
test1
_examples/test1/main.go
|
_examples/test1/main.go |
test2
_examples/test2/main.go
|
_examples/test2/main.go |
Package parser is a Pigeon-based ini file parser.
|
Package parser is a Pigeon-based ini file parser. |