Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultPath ¶
func DefaultPath() string
DefaultPath returns the path to the configuration file. It checks the JR_CONFIG_PATH environment variable first; otherwise it falls back to an OS-specific default location.
Types ¶
type AuthConfig ¶
type AuthConfig struct {
Type string `json:"type"`
Username string `json:"username,omitempty"`
Token string `json:"token,omitempty"`
ClientID string `json:"client_id,omitempty"`
ClientSecret string `json:"client_secret,omitempty"`
TokenURL string `json:"token_url,omitempty"`
Scopes string `json:"scopes,omitempty"`
}
AuthConfig holds authentication credentials for a profile.
type Config ¶
type Config struct {
Profiles map[string]Profile `json:"profiles"`
DefaultProfile string `json:"default_profile"`
}
Config is the top-level configuration structure persisted to disk.
type FlagOverrides ¶
FlagOverrides carries values supplied via CLI flags. Empty string means "not set by flag".
type Profile ¶
type Profile struct {
BaseURL string `json:"base_url"`
Auth AuthConfig `json:"auth"`
}
Profile holds the configuration for a named Jira instance.
type ResolvedConfig ¶
type ResolvedConfig struct {
BaseURL string
Auth AuthConfig
}
ResolvedConfig is the final, merged configuration ready for use.
func Resolve ¶
func Resolve(configPath, profileName string, flags *FlagOverrides) (*ResolvedConfig, error)
Resolve builds a ResolvedConfig by merging sources in priority order: CLI flags > environment variables > config file profile.
The profileName argument selects which profile to load from the config file; an empty string falls back to the DefaultProfile, then "default".