config

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2025 License: GPL-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultLogWriter added in v1.1.0

func DefaultLogWriter(version string) io.Writer

DefaultLogWriter returns the base log writer for the provided version.

func GetDefaultConfigDir added in v0.3.0

func GetDefaultConfigDir() string

GetDefaultConfigDir returns the OS-specific config directory

func InitDefaultLogger added in v1.1.0

func InitDefaultLogger(version string)

InitDefaultLogger configures zerolog with the default writer for this version. This is used by CLI entry points before a configuration file is loaded.

func WriteDefaultConfig added in v0.3.0

func WriteDefaultConfig(path string) error

Types

type AppConfig

type AppConfig struct {
	Config *domain.Config
	// contains filtered or unexported fields
}

func New

func New(configDirOrPath string, versions ...string) (*AppConfig, error)

func (*AppConfig) ApplyLogConfig

func (c *AppConfig) ApplyLogConfig()

func (*AppConfig) GetConfigDir added in v1.3.0

func (c *AppConfig) GetConfigDir() string

GetConfigDir returns the directory containing the config file

func (*AppConfig) GetDataDir

func (c *AppConfig) GetDataDir() string

GetDataDir returns the resolved data directory path.

func (*AppConfig) GetDatabasePath

func (c *AppConfig) GetDatabasePath() string

GetDatabasePath returns the path to the database file

func (*AppConfig) GetEncryptionKey

func (c *AppConfig) GetEncryptionKey() []byte

GetEncryptionKey derives a 32-byte encryption key from the session secret

func (*AppConfig) RegisterReloadListener added in v1.0.0

func (c *AppConfig) RegisterReloadListener(fn func(*domain.Config))

RegisterReloadListener registers a callback that's invoked when the configuration file is reloaded.

func (*AppConfig) SetDataDir

func (c *AppConfig) SetDataDir(dir string)

SetDataDir sets the data directory (used by CLI flags)

Jump to

Keyboard shortcuts

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