config

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const Flag = "config"

Flag is the CLI flag name for the config file path.

Variables

This section is empty.

Functions

func Flags

func Flags() []cli.Flag

Flags returns CLI flags to add to a cli.Command.

Types

type AppConfig

type AppConfig struct {
	// Env controls which mode the app runs in.
	// "development" enables the Vite dev server integration and verbose output.
	// "production" (default) serves built assets from frontend/dist.
	Env string `yaml:"env"`
}

AppConfig holds application-level settings exposed to the end user.

func (AppConfig) IsDev

func (a AppConfig) IsDev() bool

IsDev reports whether the application is running in development mode.

type Config

type Config struct {
	App      AppConfig      `yaml:"app"`
	HTTP     HTTPConfig     `yaml:"http"`
	Database DatabaseConfig `yaml:"database"`
	Log      LogConfig      `yaml:"log"`
	Osu      Osu            `yaml:"osu"`
}

Config holds only the settings that are meaningful for end users. Developer/infrastructure defaults (bind addresses, timeouts, Vite paths, tray labels, etc.) are hardcoded as constants inside their respective packages.

func Load

func Load(c *cli.Command) (*Config, error)

Load reads the YAML config file specified via --config flag. If the file does not exist, defaults are used silently.

type DatabaseConfig

type DatabaseConfig struct {
	Path string `yaml:"path"`
}

type HTTPConfig

type HTTPConfig struct {
	Port int `yaml:"port"`
}

HTTPConfig holds user-facing HTTP server settings. Low-level internals (bind address, timeouts) are hardcoded in the server package.

type LogConfig

type LogConfig struct {
	Level string `yaml:"level"` // debug | info | warn | error
}

type Osu

type Osu struct {
	Path string `yaml:"path"`
}

Jump to

Keyboard shortcuts

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