Versions in this module Expand all Collapse all v1 v1.0.0 Jul 20, 2026 Changes in this version + var ErrAlreadyExists = errors.New("inifiles: section already exists") + var ErrEmptyArg = errors.New("inifiles: empty section or parameter name") + var ErrNotFound = errors.New("inifiles: section or parameter not found") + type Config struct + func New(opts ...Option) *Config + func NewFromBytes(b []byte, opts ...Option) (*Config, error) + func NewFromFile(path string, opts ...Option) (*Config, error) + func NewFromReader(r interface{ ... }, opts ...Option) (*Config, error) + func (c *Config) AddSection(sect string) error + func (c *Config) CopySection(old, newName string, includeGroup bool) error + func (c *Config) DelVal(sect, parm string) error + func (c *Config) Delete() + func (c *Config) DeleteParameterComment(sect, parm string) error + func (c *Config) DeleteParameterEOT(sect, parm string) error + func (c *Config) DeleteSection(sect string) error + func (c *Config) DeleteSectionComment(sect string) error + func (c *Config) Errors() []ParseError + func (c *Config) Exists(sect, parm string) bool + func (c *Config) GetFileName() string + func (c *Config) GetParameterComment(sect, parm string) ([]string, bool) + func (c *Config) GetParameterEOT(sect, parm string) string + func (c *Config) GetParameterTrailingComment(sect, parm string) (string, bool) + func (c *Config) GetSectionComment(sect string) ([]string, bool) + func (c *Config) GetWriteMode() os.FileMode + func (c *Config) GroupMembers(group string) []string + func (c *Config) Groups() []string + func (c *Config) IsImported(sect, parm string) bool + func (c *Config) MyParameters(sect string) []string + func (c *Config) NewVal(sect, parm string, vals ...string) error + func (c *Config) Parameters(sect string) []string + func (c *Config) PushVal(sect, parm string, vals ...string) error + func (c *Config) Reload() error + func (c *Config) RemoveGroupMember(sect string) + func (c *Config) RenameSection(old, newName string, includeGroup bool) error + func (c *Config) ResortSections(sects []string) error + func (c *Config) Rewrite() error + func (c *Config) SectionExists(sect string) bool + func (c *Config) Sections() []string + func (c *Config) SetFileName(name string) error + func (c *Config) SetGroupMember(sect string) + func (c *Config) SetParameterComment(sect, parm string, comments ...string) (int, error) + func (c *Config) SetParameterEOT(sect, parm, eot string) error + func (c *Config) SetParameterTrailingComment(sect, parm, cmt string) error + func (c *Config) SetSectionComment(sect string, comments ...string) (int, error) + func (c *Config) SetVal(sect, parm string, vals ...string) error + func (c *Config) SetWriteMode(mode os.FileMode) + func (c *Config) Val(sect, parm string) (string, bool) + func (c *Config) ValWithDefault(sect, parm, def string) string + func (c *Config) Vals(sect, parm string) ([]string, bool) + func (c *Config) WriteFile(path string) error + func (c *Config) WriteFileDelta(path string) error + func (c *Config) WriteTo(w io.Writer) (int64, error) + func (c *Config) WriteToDelta(w io.Writer) (int64, error) + type Option func(*Options) + func WithAllowContinue(b bool) Option + func WithAllowEmpty(b bool) Option + func WithAllowedCommentChars(rs []rune) Option + func WithCommentChar(r rune) Option + func WithDefault(name string) Option + func WithFallback(name string) Option + func WithImport(c *Config) Option + func WithNegativeDeltas(b bool) Option + func WithNoCase(b bool) Option + func WithNoMultiline(b bool) Option + func WithPHPCompat(b bool) Option + func WithReloadWarn(b bool) Option + func WithReloadWriter(w *os.File) Option + func WithTrailingComment(b bool) Option + type Options struct + AllowContinue bool + AllowEmpty bool + AllowedCommentChars []rune + CommentChar rune + Default string + Fallback string + HandleTrailingComment bool + Import *Config + NegativeDeltas bool + NoCase bool + NoMultiline bool + PHPCompat bool + ReloadWarn bool + ReloadWriter *os.File + type ParseError struct + Context string + Line int + Message string + func (e *ParseError) Error() string + func (e *ParseError) Unwrap() error