Documentation ¶
Index ¶
- Constants
- func DirExists(path string) bool
- func EnsureDirExists(path string) error
- func Exists(path string) bool
- func FileExists(path string) bool
- func LoadJSON(fn string, out interface{}) error
- func SaveJSON(path string, data interface{}) error
- func WriteFile(path string, data []byte) error
- type Closer
- type INI
- type INIField
- func (f *INIField) GetBool(key string) bool
- func (f *INIField) GetFloat(key string) float64
- func (f *INIField) GetInt(key string) int
- func (f *INIField) SetBool(key string, value bool)
- func (f *INIField) SetFloat(key string, value float64)
- func (f *INIField) SetInt(key string, value int)
- func (f *INIField) SetString(key, value string)
- type INISection
Constants ¶
View Source
const ( INIBool = iota INIInt INIFloat INIString )
Variables ¶
This section is empty.
Functions ¶
func DirExists ¶
DirExists checks for the existence of a directory. It will return false if a file with that name exists.
func FileExists ¶
FileExists checks for the existence of a file. It will return false if a directory with that name exists.
Types ¶
type Closer ¶
type Closer struct {
// contains filtered or unexported fields
}
Closer holds open files to close them all in sequence, logging any errors.
type INI ¶ added in v0.3.0
type INI struct { // Sections with settings. Sections map[string]*INISection // Order sections were loaded or added in. Order []string }
INI file base structure.
func (*INI) AddSection ¶ added in v0.4.0
func (ini *INI) AddSection(name string) *INISection
type INIField ¶ added in v0.3.0
type INIField struct { // Value will be stripped of surrounding whitespace when loaded. Value string // Type lets the user choose which Get* method to use when loading unknown files. Type byte // contains filtered or unexported fields }
INIField is a variable and its data.
type INISection ¶ added in v0.3.0
type INISection struct { Fields map[string]*INIField // Order fields were loaded or added in. Order []string }
INISection holds one or more fields.
func (*INISection) AddBool ¶ added in v0.3.0
func (s *INISection) AddBool(key string, value bool)
AddBool adds a new bool field to the section.
func (*INISection) AddFloat ¶ added in v0.3.0
func (s *INISection) AddFloat(key string, value float64)
AddBool adds a new float64 field to the section.
func (*INISection) AddInt ¶ added in v0.3.0
func (s *INISection) AddInt(key string, value int)
AddBool adds a new int field to the section.
func (*INISection) AddString ¶ added in v0.3.0
func (s *INISection) AddString(key string, value string)
AddBool adds a new string field to the section.
Click to show internal directories.
Click to hide internal directories.