Documentation
¶
Index ¶
Constants ¶
const ( ConfigFileName = ".pipeops.json" ConfigDirName = ".pipeops" )
Variables ¶
var ( // These can be set during build using -ldflags DefaultClientID = "pipeops_public_client" // Can be overridden at build time DefaultAPIURL = "https://api.pipeops.io" // Can be overridden at build time DefaultDashboardURL = "https://console.pipeops.io" // Can be overridden at build time DefaultScopes = "openid profile email" // Can be overridden at build time )
Build-time configuration variables (set during compilation)
Functions ¶
func GetAPIURL ¶ added in v0.2.9
func GetAPIURL() string
GetAPIURL returns the API URL from environment or build-time default
func GetClientID ¶ added in v0.2.9
func GetClientID() string
GetClientID returns the OAuth client ID from environment or build-time default
func GetConfigDir ¶
GetConfigDir returns the configuration directory path
func GetDashboardURL ¶ added in v0.2.32
func GetDashboardURL() string
GetDashboardURL returns the Dashboard URL from environment or build-time default
func GetDefaultScopes ¶ added in v0.2.9
func GetDefaultScopes() []string
GetDefaultScopes returns the default scopes
Types ¶
type Config ¶
type Config struct {
OAuth *OAuthConfig `json:"oauth,omitempty"`
Settings *Settings `json:"settings,omitempty"`
Updates *UpdateSettings `json:"updates,omitempty"`
Version *VersionInfo `json:"version,omitempty"`
}
Config represents the CLI configuration
func DefaultConfig ¶
func DefaultConfig() *Config
DefaultConfig returns a new config with default values
func (*Config) ClearAuth ¶
func (c *Config) ClearAuth()
ClearAuth removes authentication information
func (*Config) IsAuthenticated ¶
IsAuthenticated checks if the user has valid authentication
func (*Config) IsAuthenticatedWithServer ¶ added in v0.2.9
IsAuthenticatedWithServer validates authentication with the server
type OAuthConfig ¶
type OAuthConfig struct {
ClientID string `json:"client_id"`
ClientSecret string `json:"client_secret"` // Not used with PKCE, kept for compatibility
BaseURL string `json:"base_url"`
DashboardURL string `json:"dashboard_url"`
AccessToken string `json:"access_token,omitempty"`
RefreshToken string `json:"refresh_token,omitempty"`
ExpiresAt time.Time `json:"expires_at,omitempty"`
Scopes []string `json:"scopes,omitempty"`
}
OAuthConfig holds OAuth-related configuration
type Settings ¶
type Settings struct {
DefaultRegion string `json:"default_region,omitempty"`
// DefaultClusterUUID is used by APIs that are scoped to a specific cluster.
// It can be overridden per-invocation with the PIPEOPS_CLUSTER_UUID env var.
DefaultClusterUUID string `json:"default_cluster_uuid,omitempty"`
// DefaultWorkspaceUUID is used by APIs that are scoped to a workspace.
// It can be overridden per-invocation with the PIPEOPS_WORKSPACE_UUID env var.
DefaultWorkspaceUUID string `json:"default_workspace_uuid,omitempty"`
OutputFormat string `json:"output_format,omitempty"`
Debug bool `json:"debug,omitempty"`
}
Settings holds general CLI settings
type UpdateSettings ¶ added in v0.2.48
type UpdateSettings struct {
LastUpdateCheck time.Time `json:"last_update_check"`
SkipUpdateCheck bool `json:"skip_update_check"`
}
UpdateSettings holds update check related information
type VersionInfo ¶ added in v0.2.48
type VersionInfo struct {
Version string `json:"version"`
}
VersionInfo holds version information