Documentation
¶
Overview ¶
Package config manages user-level configuration for the FTL CLI
Index ¶
- type Config
- func (c *Config) AddOrganization(info OrgInfo) error
- func (c *Config) ClearCurrentUser() error
- func (c *Config) GetCurrentOrg() string
- func (c *Config) GetCurrentUser() *UserInfo
- func (c *Config) GetDefaultEnvironment() string
- func (c *Config) GetOrganization(orgID string) (OrgInfo, bool)
- func (c *Config) ListOrganizations() []OrgInfo
- func (c *Config) Reset() error
- func (c *Config) Save() error
- func (c *Config) SetCurrentOrg(orgID string) error
- func (c *Config) SetCurrentUser(user *UserInfo) error
- func (c *Config) SetDefaultEnvironment(env string) error
- type OrgInfo
- type Preferences
- type UserInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// CurrentOrg is the currently selected organization
CurrentOrg string `json:"current_org,omitempty"`
// DefaultEnvironment is the default deployment environment
DefaultEnvironment string `json:"default_environment,omitempty"`
// Organizations stores metadata about known organizations
Organizations map[string]OrgInfo `json:"organizations,omitempty"`
// Preferences stores user preferences
Preferences Preferences `json:"preferences,omitempty"`
// LastUpdateCheck tracks when we last checked for updates
LastUpdateCheck string `json:"last_update_check,omitempty"`
// CurrentUser stores info about the logged-in user
CurrentUser *UserInfo `json:"current_user,omitempty"`
// Version of the config schema
Version string `json:"version"`
}
Config represents the user's FTL CLI configuration
func (*Config) AddOrganization ¶
AddOrganization adds or updates organization info
func (*Config) ClearCurrentUser ¶
ClearCurrentUser removes the current user info
func (*Config) GetCurrentOrg ¶
GetCurrentOrg returns the currently selected organization
func (*Config) GetCurrentUser ¶
GetCurrentUser returns the current user info
func (*Config) GetDefaultEnvironment ¶
GetDefaultEnvironment returns the default environment for deployments
func (*Config) GetOrganization ¶
GetOrganization retrieves organization info
func (*Config) ListOrganizations ¶
ListOrganizations returns all known organizations
func (*Config) SetCurrentOrg ¶
SetCurrentOrg sets the currently selected organization
func (*Config) SetCurrentUser ¶
SetCurrentUser updates the current user info
func (*Config) SetDefaultEnvironment ¶
SetDefaultEnvironment sets the default environment
type OrgInfo ¶
type OrgInfo struct {
ID string `json:"id"`
Name string `json:"name,omitempty"`
LastUsed string `json:"last_used,omitempty"`
IsDefault bool `json:"is_default,omitempty"`
Environment string `json:"environment,omitempty"` // Default env for this org
}
OrgInfo stores information about an organization
type Preferences ¶
type Preferences struct {
// ColorOutput controls whether to use colored output
ColorOutput bool `json:"color_output"`
// Verbose controls verbose output
Verbose bool `json:"verbose"`
// AutoUpdate controls automatic update checks
AutoUpdate bool `json:"auto_update"`
// ConfirmDeploy controls whether to confirm before deploying
ConfirmDeploy bool `json:"confirm_deploy"`
}
Preferences stores user preferences