config

package
v0.1.3 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClearTokens

func ClearTokens() error

ClearTokens removes all auth tokens from the config and saves.

func GetAPIKey

func GetAPIKey() string

GetAPIKey returns the configured API key.

func GetAPIURL

func GetAPIURL() string

GetAPIURL returns the configured API URL.

func GetAccessToken

func GetAccessToken() string

GetAccessToken returns the stored access token.

func GetAllSettings

func GetAllSettings() map[string]any

GetAllSettings returns all config settings as a map.

func GetConfigDir

func GetConfigDir() string

GetConfigDir returns the path to the stompy config directory (~/.stompy).

func GetConfigPath

func GetConfigPath() string

GetConfigPath returns the path to the stompy config file (~/.stompy/config.yaml).

func GetDefaultProject

func GetDefaultProject() string

GetDefaultProject returns the configured default project.

func GetEmail

func GetEmail() string

GetEmail returns the stored user email.

func GetOutputFormat

func GetOutputFormat() string

GetOutputFormat returns the configured output format.

func GetRefreshToken

func GetRefreshToken() string

GetRefreshToken returns the stored refresh token.

func GetTokenExpiry

func GetTokenExpiry() time.Time

GetTokenExpiry returns the stored token expiry time.

func GetValue

func GetValue(key string) string

GetValue returns the string value for a config key.

func Load

func Load() error

Load initializes Viper, sets defaults, and reads the config file if it exists.

func ResolveProject

func ResolveProject(flagValue string) (string, error)

ResolveProject determines the active project using this precedence: 1. Explicit flag value 2. STOMPY_PROJECT environment variable 3. default_project from config Returns an error if no project can be resolved.

func Save

func Save() error

Save writes the current Viper config to the config file, creating the directory if needed.

func SaveTokens

func SaveTokens(accessToken, refreshToken string, expiry time.Time, email, userID string) error

SaveTokens persists auth tokens and user info to the config file.

func SetValue

func SetValue(key, value string) error

SetValue sets a config key to the given value and saves.

Types

This section is empty.

Jump to

Keyboard shortcuts

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