Versions in this module Expand all Collapse all v0 v0.6.0 Jul 5, 2019 Changes in this version + const DEFAULT_SECTION + var DefaultHeader = false + var LineBreak = "\n" + var PrettyEqual = false + var PrettyFormat = true + var PrettySection = true + func IsErrDelimiterNotFound(err error) bool + func MapTo(v, source interface{}, others ...interface{}) error + func MapToWithMapper(v interface{}, mapper NameMapper, source interface{}, others ...interface{}) error + func ReflectFrom(cfg *File, v interface{}) error + func ReflectFromWithMapper(cfg *File, v interface{}, mapper NameMapper) error + func StrictMapTo(v, source interface{}, others ...interface{}) error + func StrictMapToWithMapper(v interface{}, mapper NameMapper, source interface{}, others ...interface{}) error + func Version() string + type ErrDelimiterNotFound struct + Line string + func (err ErrDelimiterNotFound) Error() string + type File struct + BlockMode bool + func Empty() *File + func InsensitiveLoad(source interface{}, others ...interface{}) (*File, error) + func Load(source interface{}, others ...interface{}) (*File, error) + func LoadSources(opts LoadOptions, source interface{}, others ...interface{}) (_ *File, err error) + func LooseLoad(source interface{}, others ...interface{}) (*File, error) + func ShadowLoad(source interface{}, others ...interface{}) (*File, error) + func (f *File) Append(source interface{}, others ...interface{}) error + func (f *File) ChildSections(name string) []*Section + func (f *File) DeleteSection(name string) + func (f *File) GetSection(name string) (*Section, error) + func (f *File) MapTo(v interface{}) error + func (f *File) NewRawSection(name, body string) (*Section, error) + func (f *File) NewSection(name string) (*Section, error) + func (f *File) NewSections(names ...string) (err error) + func (f *File) ReflectFrom(v interface{}) error + func (f *File) Reload() (err error) + func (f *File) SaveTo(filename string) error + func (f *File) SaveToIndent(filename, indent string) error + func (f *File) Section(name string) *Section + func (f *File) SectionStrings() []string + func (f *File) Sections() []*Section + func (f *File) StrictMapTo(v interface{}) error + func (f *File) WriteTo(w io.Writer) (int64, error) + func (f *File) WriteToIndent(w io.Writer, indent string) (int64, error) + type Key struct + Comment string + func (k *Key) AddNestedValue(val string) error + func (k *Key) AddShadow(val string) error + func (k *Key) Bool() (bool, error) + func (k *Key) Duration() (time.Duration, error) + func (k *Key) Float64() (float64, error) + func (k *Key) Float64s(delim string) []float64 + func (k *Key) In(defaultVal string, candidates []string) string + func (k *Key) InFloat64(defaultVal float64, candidates []float64) float64 + func (k *Key) InInt(defaultVal int, candidates []int) int + func (k *Key) InInt64(defaultVal int64, candidates []int64) int64 + func (k *Key) InTime(defaultVal time.Time, candidates []time.Time) time.Time + func (k *Key) InTimeFormat(format string, defaultVal time.Time, candidates []time.Time) time.Time + func (k *Key) InUint(defaultVal uint, candidates []uint) uint + func (k *Key) InUint64(defaultVal uint64, candidates []uint64) uint64 + func (k *Key) Int() (int, error) + func (k *Key) Int64() (int64, error) + func (k *Key) Int64s(delim string) []int64 + func (k *Key) Ints(delim string) []int + func (k *Key) MustBool(defaultVal ...bool) bool + func (k *Key) MustDuration(defaultVal ...time.Duration) time.Duration + func (k *Key) MustFloat64(defaultVal ...float64) float64 + func (k *Key) MustInt(defaultVal ...int) int + func (k *Key) MustInt64(defaultVal ...int64) int64 + func (k *Key) MustString(defaultVal string) string + func (k *Key) MustTime(defaultVal ...time.Time) time.Time + func (k *Key) MustTimeFormat(format string, defaultVal ...time.Time) time.Time + func (k *Key) MustUint(defaultVal ...uint) uint + func (k *Key) MustUint64(defaultVal ...uint64) uint64 + func (k *Key) Name() string + func (k *Key) NestedValues() []string + func (k *Key) RangeFloat64(defaultVal, min, max float64) float64 + func (k *Key) RangeInt(defaultVal, min, max int) int + func (k *Key) RangeInt64(defaultVal, min, max int64) int64 + func (k *Key) RangeTime(defaultVal, min, max time.Time) time.Time + func (k *Key) RangeTimeFormat(format string, defaultVal, min, max time.Time) time.Time + func (k *Key) SetValue(v string) + func (k *Key) StrictFloat64s(delim string) ([]float64, error) + func (k *Key) StrictInt64s(delim string) ([]int64, error) + func (k *Key) StrictInts(delim string) ([]int, error) + func (k *Key) StrictTimes(delim string) ([]time.Time, error) + func (k *Key) StrictTimesFormat(format, delim string) ([]time.Time, error) + func (k *Key) StrictUint64s(delim string) ([]uint64, error) + func (k *Key) StrictUints(delim string) ([]uint, error) + func (k *Key) String() string + func (k *Key) Strings(delim string) []string + func (k *Key) StringsWithShadows(delim string) []string + func (k *Key) Time() (time.Time, error) + func (k *Key) TimeFormat(format string) (time.Time, error) + func (k *Key) Times(delim string) []time.Time + func (k *Key) TimesFormat(format, delim string) []time.Time + func (k *Key) Uint() (uint, error) + func (k *Key) Uint64() (uint64, error) + func (k *Key) Uint64s(delim string) []uint64 + func (k *Key) Uints(delim string) []uint + func (k *Key) ValidFloat64s(delim string) []float64 + func (k *Key) ValidInt64s(delim string) []int64 + func (k *Key) ValidInts(delim string) []int + func (k *Key) ValidTimes(delim string) []time.Time + func (k *Key) ValidTimesFormat(format, delim string) []time.Time + func (k *Key) ValidUint64s(delim string) []uint64 + func (k *Key) ValidUints(delim string) []uint + func (k *Key) Validate(fn func(string) string) string + func (k *Key) Value() string + func (k *Key) ValueWithShadows() []string + type LoadOptions struct + AllowBooleanKeys bool + AllowNestedValues bool + AllowPythonMultilineValues bool + AllowShadows bool + IgnoreContinuation bool + IgnoreInlineComment bool + Insensitive bool + Loose bool + SpaceBeforeInlineComment bool + UnescapeValueCommentSymbols bool + UnescapeValueDoubleQuotes bool + UnparseableSections []string + type NameMapper func(string) string + var AllCapsUnderscore NameMapper = func(raw string) string { ... } + var TitleUnderscore NameMapper = func(raw string) string { ... } + type Section struct + Comment string + func (s *Section) Body() string + func (s *Section) ChildSections() []*Section + func (s *Section) DeleteKey(name string) + func (s *Section) GetKey(name string) (*Key, error) + func (s *Section) HasKey(name string) bool + func (s *Section) HasValue(value string) bool + func (s *Section) Haskey(name string) bool + func (s *Section) Key(name string) *Key + func (s *Section) KeyStrings() []string + func (s *Section) Keys() []*Key + func (s *Section) KeysHash() map[string]string + func (s *Section) MapTo(v interface{}) error + func (s *Section) Name() string + func (s *Section) NewBooleanKey(name string) (*Key, error) + func (s *Section) NewKey(name, val string) (*Key, error) + func (s *Section) ParentKeys() []*Key + func (s *Section) ReflectFrom(v interface{}) error + func (s *Section) SetBody(body string) + func (s *Section) StrictMapTo(v interface{}) error + type ValueMapper func(string) string