config

package
v0.6.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 21, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var FileName = sync.OnceValue(func() string {
	return os.ExpandEnv("${HOME}/.config/" + instance.AppName() + ".yaml")
})

Functions

func AddKey

func AddKey[T any](key ConfigKey[T])

func Get

func Get[T any](key ConfigKey[T]) T

func Initialize

func Initialize() error

func IsDirty

func IsDirty() bool

func Save

func Save() error

func SetDirty

func SetDirty()

Types

type ConfigKey

type ConfigKey[T any] interface {
	Name() string
	New() T
	NewFrom(value any) (T, error)
	IsDefault(value T) bool
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL