config

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetEnv

func GetEnv(key string) string

GetEnv retrieves an environment variable with Octrafic prefix

func GetEnvVarName

func GetEnvVarName(key string) string

GetEnvVarName returns the environment variable name for a config key

func IsFirstLaunch

func IsFirstLaunch() (bool, error)

IsFirstLaunch checks if this is the first launch (no config or not onboarded)

func IsLocalProvider added in v0.2.0

func IsLocalProvider(provider string) bool

IsLocalProvider returns true for providers that don't require an API key

Types

type Config

type Config struct {
	Provider        string    `json:"provider"`
	APIKey          string    `json:"api_key,omitempty"`
	BaseURL         string    `json:"base_url,omitempty"`
	Model           string    `json:"model"`
	Onboarded       bool      `json:"onboarded"`
	LastUpdateCheck time.Time `json:"last_update_check,omitempty"`
	LatestVersion   string    `json:"latest_version,omitempty"`
}

Config holds the application configuration

func Load

func Load() (*Config, error)

Load loads the configuration from disk

func (*Config) Save

func (c *Config) Save() error

Save saves the configuration to disk

func (*Config) ShouldCheckForUpdate added in v0.2.0

func (c *Config) ShouldCheckForUpdate() bool

ShouldCheckForUpdate returns true if more than 24 hours since last check

Jump to

Keyboard shortcuts

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