config

package
v0.3.14 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DataDir

func DataDir() string

DataDir returns the application data directory.

func DetectGameLog

func DetectGameLog() string

DetectGameLog attempts to find Game.log using multiple strategies: 0. RSI Launcher log — reads exact channel paths from the launcher's own log file 1. Running process — queries the live StarCitizen.exe process path via WMIC 2. Windows Registry — reads RSI Launcher install path (HKLM and HKCU) 3. Launcher exe — searches drives for StarCitizen_Launcher.exe 4. Drive scanning — checks common install patterns on all drives Returns the first match found, preferring the most recently launched channel.

func DetectedLogPath added in v0.3.4

func DetectedLogPath() string

DetectedLogPath returns the auto-detected path or empty string. This is separate from DetectGameLog so we can show the detected path to the user even when they've set a manual override.

func EndpointForEnv

func EndpointForEnv(env string) string

EndpointForEnv returns the API endpoint for the given environment.

func ValidateLogPath added in v0.3.4

func ValidateLogPath(path string) bool

ValidateLogPath checks if the given path points to a readable file.

Types

type Config

type Config struct {
	LogPath        string `yaml:"log_path"`
	APIEndpoint    string `yaml:"api_endpoint"`
	APIToken       string `yaml:"api_token"`
	Environment    string `yaml:"environment"`
	MinimizeToTray bool   `yaml:"minimize_to_tray"`
}

Config holds application configuration.

func Default

func Default() *Config

Default returns a config with sensible defaults.

func Load

func Load(path string) (*Config, error)

Load reads config from a YAML file.

func (*Config) Save

func (c *Config) Save(path string) error

Save writes the config to a YAML file.

type SyncPreferences

type SyncPreferences struct {
	SyncEnabled map[string]bool `json:"sync_enabled"`
}

SyncPreferences controls which event types are synced to the API.

func DefaultSyncPreferences

func DefaultSyncPreferences() *SyncPreferences

DefaultSyncPreferences returns preferences with sync-worthy types enabled.

func LoadSyncPreferences

func LoadSyncPreferences() *SyncPreferences

LoadSyncPreferences reads preferences from the data directory.

func (*SyncPreferences) IsEnabled

func (p *SyncPreferences) IsEnabled(eventType string) bool

IsEnabled returns whether an event type should be synced.

func (*SyncPreferences) Save

func (p *SyncPreferences) Save() error

Save writes preferences to the data directory.

Jump to

Keyboard shortcuts

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