Versions in this module Expand all Collapse all v0 v0.1.2 Oct 10, 2026 v0.1.1 Oct 10, 2026 v0.1.0 Oct 10, 2026 Changes in this version + const DefaultDebounce + const DefaultMaxBytes + const DefaultMaxLine + var ErrNotRegular = errors.New("not a regular file") + var ErrNotUTF8 = errors.New("kvconf: file is not valid UTF-8") + var ErrTooLarge = errors.New("kvconf: file too large") + func Changed(old, cur map[string]string) []string + func DefaultPath(app, name string) (string, error) + func ExpandPath(s string) (string, error) + func Marshal(v any) ([]byte, error) + func Open[T any](path string, opts LiveOptions[T]) (*Live[T], []Warning, error) + func Parse(r io.Reader, opts Options) ([]Entry, []Warning, error) + func ParseBool(s string) (bool, error) + func ParseBytes(data []byte, opts Options) ([]Entry, []Warning, error) + func Quote(v string) string + func ReadFile(path string, opts Options) ([]byte, error) + func Set(data []byte, values map[string]*string) ([]byte, error) + func SetFile(path string, values map[string]*string, perm os.FileMode) error + func Values(entries []Entry) map[string]string + func Watch(ctx context.Context, path string, opts WatchOptions, out chan<- struct{}) error + func WriteFile(path string, data []byte, perm os.FileMode) error + type Change struct + Keys []string + New *T + Old *T + Warnings []Warning + type CommentStyle uint8 + const CommentAny + const CommentLine + const CommentSpaced + type Defaulter interface + SetDefaults func() + type Entry struct + Key string + Line int + Value string + type Live struct + func (l *Live[T]) Get() *T + func (l *Live[T]) Path() string + func (l *Live[T]) Run(ctx context.Context) error + type LiveOptions struct + OnChange func(Change[T]) + OnError func(error) + Watch WatchOptions + type Options struct + AllowDuplicates bool + AllowUnknown bool + Comments CommentStyle + MaxBytes int64 + MaxLine int + RawValues bool + RequireFile bool + Strict bool + type Path string + func (p *Path) UnmarshalText(text []byte) error + func (p Path) MarshalText() ([]byte, error) + type Validator interface + Validate func() error + type ValueError string + func (e ValueError) Error() string + type Warning struct + Key string + Line int + Msg string + func Decode(entries []Entry, v any, opts Options) ([]Warning, error) + func Load[T any](path string, opts Options) (*T, []Warning, error) + func Unmarshal(data []byte, v any, opts Options) ([]Warning, error) + func (w Warning) Error() string + type WatchOptions struct + Debounce time.Duration + Dir bool + Poll time.Duration + Ready chan<- struct{}