Documentation
¶
Index ¶
- func ClearTokens() error
- func GetAPIKey() string
- func GetAPIURL() string
- func GetAccessToken() string
- func GetAllSettings() map[string]any
- func GetConfigDir() string
- func GetConfigPath() string
- func GetDefaultProject() string
- func GetEmail() string
- func GetOutputFormat() string
- func GetRefreshToken() string
- func GetTokenExpiry() time.Time
- func GetValue(key string) string
- func Load() error
- func ResolveProject(flagValue string) (string, error)
- func Save() error
- func SaveTokens(accessToken, refreshToken string, expiry time.Time, email, userID string) error
- func SetValue(key, value string) error
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 GetAllSettings ¶
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 GetOutputFormat ¶
func GetOutputFormat() string
GetOutputFormat returns the configured output format.
func GetRefreshToken ¶
func GetRefreshToken() string
GetRefreshToken returns the stored refresh token.
func GetTokenExpiry ¶
GetTokenExpiry returns the stored token expiry time.
func Load ¶
func Load() error
Load initializes Viper, sets defaults, and reads the config file if it exists.
func ResolveProject ¶
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 ¶
SaveTokens persists auth tokens and user info to the config file.
Types ¶
This section is empty.