config

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnsureUserDataDir

func EnsureUserDataDir() error

EnsureUserDataDir ensures the user data directory exists

func GetConfigPath

func GetConfigPath() string

GetConfigPath returns the path to the config file

func GetDefaultDBPath

func GetDefaultDBPath() string

GetDefaultDBPath returns the default SQLite database path

func GetLogDir

func GetLogDir() string

GetLogDir returns the log directory path

func GetLogPath

func GetLogPath() string

GetLogPath returns the log file path

func GetPIDPath

func GetPIDPath() string

GetPIDPath returns the path to the PID file

func GetUserDataDir

func GetUserDataDir() string

GetUserDataDir returns the user data directory for Knot - Linux/macOS: ~/.knot - Windows: %LOCALAPPDATA%/knot

func InitConfig

func InitConfig() error

InitConfig initializes the configuration file with defaults

func SaveConfig

func SaveConfig(config *Config) error

SaveConfig saves configuration to file

func ShowConfig

func ShowConfig() error

ShowConfig displays the current configuration

Types

type Config

type Config struct {
	DatabaseType  string `mapstructure:"databaseType"`
	SQLitePath    string `mapstructure:"sqlitePath"`
	PostgresURL   string `mapstructure:"postgresUrl"`
	MySQLURL      string `mapstructure:"mysqlUrl"`
	Port          int    `mapstructure:"port"`
	Host          string `mapstructure:"host"`
	EnableLogging bool   `mapstructure:"enableLogging"`
}

Config holds the application configuration

func LoadConfig

func LoadConfig() (*Config, error)

LoadConfig loads configuration from file and defaults

Jump to

Keyboard shortcuts

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