config

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: May 7, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SaveProfile

func SaveProfile(configDir string, p *Profile) error

SaveProfile writes the profile to configDir/profile.yaml.

Types

type Config

type Config struct {
	CompanyRepo     string         `yaml:"company_repo,omitempty"`
	Language        string         `yaml:"language,omitempty"` // e.g. "de"; empty = auto-detect from locale
	Location        string         `yaml:"location,omitempty"`
	Sync            SyncConfig     `yaml:"sync"`
	Tip             TipConfig      `yaml:"tip,omitempty"`
	Events          EventsConfig   `yaml:"events,omitempty"`
	Tutorial        TutorialConfig `yaml:"tutorial,omitempty"`
	ExperienceLevel string         `yaml:"experience_level,omitempty"`
	Service         ServiceConfig  `yaml:"service,omitempty"`
	Tray            TrayConfig     `yaml:"tray,omitempty"`
}

Config holds user-level tool configuration from ~/.config/sap-devs/config.yaml.

func Default

func Default() *Config

Default returns a Config with factory defaults applied.

func Load

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

Load reads config.yaml from configDir. Returns defaults if the file does not exist.

func (*Config) Save

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

Save writes the config to configDir/config.yaml, creating the directory if needed.

type EventsConfig

type EventsConfig struct {
	LocalRadius    int    `yaml:"local_radius,omitempty"`
	RegionalRadius int    `yaml:"regional_radius,omitempty"`
	NotifyDays     int    `yaml:"notify_days,omitempty"`
	NotifyMethod   string `yaml:"notify_method,omitempty"`
}

EventsConfig controls event filtering and notification behaviour.

func (EventsConfig) EffectiveLocalRadius

func (e EventsConfig) EffectiveLocalRadius() int

func (EventsConfig) EffectiveNotifyDays

func (e EventsConfig) EffectiveNotifyDays() int

func (EventsConfig) EffectiveRegionalRadius

func (e EventsConfig) EffectiveRegionalRadius() int

type Profile

type Profile struct {
	ID string `yaml:"id"`
}

Profile holds the user's active developer persona.

func LoadProfile

func LoadProfile(configDir string) (*Profile, error)

LoadProfile reads profile.yaml from configDir. Returns empty profile if file does not exist.

type ServiceConfig

type ServiceConfig struct {
	Interval time.Duration `yaml:"interval"`
}

ServiceConfig controls the OS-native background scheduler.

type SyncConfig

type SyncConfig struct {
	Tips      time.Duration `yaml:"tips"`
	Tools     time.Duration `yaml:"tools"`
	Advocates time.Duration `yaml:"advocates"`
	Resources time.Duration `yaml:"resources"`
	Context   time.Duration `yaml:"context"`
	MCP       time.Duration `yaml:"mcp"`
	Events    time.Duration `yaml:"events"`
	YouTube   time.Duration `yaml:"youtube"`
	News      time.Duration `yaml:"news"`
	Discovery time.Duration `yaml:"discovery"`
	Tutorials time.Duration `yaml:"tutorials"`
	Learning  time.Duration `yaml:"learning"`
	Disabled  bool          `yaml:"disabled"`
}

SyncConfig controls per-category TTLs for background content refresh.

type TipConfig

type TipConfig struct {
	Rotation string `yaml:"rotation,omitempty"` // "daily" | "hourly" | "session"; empty = "daily"
}

TipConfig controls tip display behaviour.

type TrayConfig

type TrayConfig struct {
	Autostart bool   `yaml:"autostart,omitempty"`
	Theme     string `yaml:"theme,omitempty"`
}

TrayConfig controls the optional GUI tray companion.

type TutorialConfig

type TutorialConfig struct {
	Interactive bool `yaml:"interactive,omitempty"`
}

TutorialConfig controls tutorial display behaviour.

Jump to

Keyboard shortcuts

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