config

package
v0.0.0-...-f028939 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2026 License: AGPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewLogger

func NewLogger(cfg *Config) *slog.Logger

func SetupObservability

func SetupObservability(lc fx.Lifecycle, cfg *Config, log *slog.Logger) error

SetupObservability initializes OpenTelemetry tracing, Prometheus metrics, and Sentry.

Types

type AIConfig

type AIConfig struct {
	Enabled      bool   `koanf:"enabled"`
	Provider     string `koanf:"provider"` // "ollama" or "claude"
	OllamaAddr   string `koanf:"ollama_addr"`
	OllamaModel  string `koanf:"ollama_model"`
	ClaudeAPIKey string `koanf:"claude_api_key"`
	ClaudeModel  string `koanf:"claude_model"`
}

type APIKeyConfig

type APIKeyConfig struct {
	APIKey string `koanf:"api_key"`
}

type AuthConfig

type AuthConfig struct {
	OIDC    OIDCConfig    `koanf:"oidc"`
	Session SessionConfig `koanf:"session"`
}

type CacheConfig

type CacheConfig struct {
	Dragonfly DragonflyConfig `koanf:"dragonfly"`
	Memory    MemoryConfig    `koanf:"memory"`
}

type Config

type Config struct {
	Server   ServerConfig   `koanf:"server"`
	Database DatabaseConfig `koanf:"database"`
	Cache    CacheConfig    `koanf:"cache"`
	Storage  StorageConfig  `koanf:"storage"`
	Search   SearchConfig   `koanf:"search"`
	Auth     AuthConfig     `koanf:"auth"`
	Scan     ScanConfig     `koanf:"scan"`
	Metadata MetadataConfig `koanf:"metadata"`
	AI       AIConfig       `koanf:"ai"`
	Log      LogConfig      `koanf:"log"`
	Sentry   SentryConfig   `koanf:"sentry"`
}

func New

func New() (*Config, error)

type DatabaseConfig

type DatabaseConfig struct {
	Host     string `koanf:"host"`
	Port     int    `koanf:"port"`
	User     string `koanf:"user"`
	Password string `koanf:"password"`
	Name     string `koanf:"name"`
	SSLMode  string `koanf:"ssl_mode"`
	MaxConns int32  `koanf:"max_conns"`
	MinConns int32  `koanf:"min_conns"`
}

func (DatabaseConfig) DSN

func (c DatabaseConfig) DSN() string

type DragonflyConfig

type DragonflyConfig struct {
	Addr     string `koanf:"addr"`
	Password string `koanf:"password"`
	DB       int    `koanf:"db"`
}

type IGDBConfig

type IGDBConfig struct {
	ClientID     string `koanf:"client_id"`
	ClientSecret string `koanf:"client_secret"`
}

type LaunchBoxConfig

type LaunchBoxConfig struct {
	Enabled   bool `koanf:"enabled"`
	RemoteAPI bool `koanf:"remote_api"`
}

type LocalFS

type LocalFS struct {
	RootPath string `koanf:"root_path"`
}

type LogConfig

type LogConfig struct {
	Level  string `koanf:"level"`
	Format string `koanf:"format"` // "json", "text"
}

type MemoryConfig

type MemoryConfig struct {
	MaxSize int `koanf:"max_size"`
}

type MetadataConfig

type MetadataConfig struct {
	IGDB              IGDBConfig             `koanf:"igdb"`
	MobyGames         APIKeyConfig           `koanf:"mobygames"`
	Screenscraper     ScreenscraperConfig    `koanf:"screenscraper"`
	SteamGridDB       APIKeyConfig           `koanf:"steamgriddb"`
	RetroAchievements APIKeyConfig           `koanf:"retroachievements"`
	LaunchBox         LaunchBoxConfig        `koanf:"launchbox"`
	Hasheous          ToggleConfig           `koanf:"hasheous"`
	TheGamesDB        ToggleConfig           `koanf:"thegamesdb"`
	Flashpoint        ToggleConfig           `koanf:"flashpoint"`
	HowLongToBeat     ToggleConfig           `koanf:"howlongtobeat"`
	Playmatch         ToggleConfig           `koanf:"playmatch"`
	Priority          MetadataPriorityConfig `koanf:"priority"`
}

type MetadataPriorityConfig

type MetadataPriorityConfig struct {
	Metadata []string `koanf:"metadata"`
	Artwork  []string `koanf:"artwork"`
}

type OIDCConfig

type OIDCConfig struct {
	Enabled      bool   `koanf:"enabled"`
	Issuer       string `koanf:"issuer"`
	ClientID     string `koanf:"client_id"`
	ClientSecret string `koanf:"client_secret"`
	RedirectURL  string `koanf:"redirect_url"`
}

type S3Config

type S3Config struct {
	Endpoint  string `koanf:"endpoint"`
	Bucket    string `koanf:"bucket"`
	Region    string `koanf:"region"`
	AccessKey string `koanf:"access_key"`
	SecretKey string `koanf:"secret_key"`
	UseSSL    bool   `koanf:"use_ssl"`
}

type ScanConfig

type ScanConfig struct {
	WatchEnabled bool   `koanf:"watch_enabled"`
	WatchDelay   string `koanf:"watch_delay"`
	CronSchedule string `koanf:"cron_schedule"`
}

type ScreenscraperConfig

type ScreenscraperConfig struct {
	User     string `koanf:"user"`
	Password string `koanf:"password"`
}

type SearchConfig

type SearchConfig struct {
	Addr   string `koanf:"addr"`
	APIKey string `koanf:"api_key"`
}

type SentryConfig

type SentryConfig struct {
	Enabled bool   `koanf:"enabled"`
	DSN     string `koanf:"dsn"`
}

type ServerConfig

type ServerConfig struct {
	Host string `koanf:"host"`
	Port int    `koanf:"port"`
}

type SessionConfig

type SessionConfig struct {
	Secret   string `koanf:"secret"`
	MaxAge   int    `koanf:"max_age"`
	HTTPOnly bool   `koanf:"http_only"`
	Secure   bool   `koanf:"secure"`
}

type StorageConfig

type StorageConfig struct {
	Type     string   `koanf:"type"` // "local", "s3", "both"
	Local    LocalFS  `koanf:"local"`
	S3       S3Config `koanf:"s3"`
	LibPath  string   `koanf:"lib_path"`
	DATPath  string   `koanf:"dat_path"`
	TempPath string   `koanf:"temp_path"`
}

type ToggleConfig

type ToggleConfig struct {
	Enabled bool `koanf:"enabled"`
}

Jump to

Keyboard shortcuts

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