Versions in this module Expand all Collapse all v0 v0.2.0 Jun 12, 2026 Changes in this version + const ActiveProfileFileName + const DefaultHostname + const DeviceIDFileName + const ProfileDir + const ProfileNameDefault + const TerraformCredentialsPath + var ConfigDir = fmt.Sprintf("~/.config/%s/", version.Name) + var ErrActiveProfileFileEmpty = errors.New("active profile is unset") + var ErrInvalidFileID = errors.New("invalid file ID: must be a file name without path components") + var ErrInvalidProfileName = errors.New(...) + var ErrNoActiveProfileFilePresent = errors.New("active profile file doesn't exist") + var ErrNoProfileFilePresent = errors.New("profile configuration file doesn't exist") + func PropertyNames() map[string]struct + type ActiveProfile struct + Name string + func (c *ActiveProfile) Write() error + type CheckRefreshFunc func(mTime *time.Time) RefreshResult + type FileID string + type HostCacheLoader struct + func NewHostCacheLoader(ctx context.Context, baseDir, hostname string) (*HostCacheLoader, error) + func (h HostCacheLoader) ReadOrRefresh(fileID FileID, check CheckRefreshFunc) ([]byte, error) + func (h HostCacheLoader) Write(fileID FileID, data []byte, lastModified *time.Time) error + type Loader struct + func NewLoader() (*Loader, error) + func TestLoader(t *testing.T) *Loader + func (l *Loader) DefaultActiveProfile() *ActiveProfile + func (l *Loader) DefaultProfile() *Profile + func (l *Loader) DeleteProfile(name string) error + func (l *Loader) GetActiveProfile() (*ActiveProfile, error) + func (l *Loader) GetDeviceID(ctx context.Context) string + func (l *Loader) ListProfiles() ([]string, error) + func (l *Loader) LoadProfile(name string) (*Profile, error) + func (l *Loader) LoadProfiles() ([]*Profile, error) + func (l *Loader) NewProfile(name string) (*Profile, error) + type Profile struct + DefaultOrganization string + Hostname string + Name string + NoColor *bool + Telemetry *string + Token string + func TestProfile(t *testing.T) *Profile + func (p *Profile) Clean() + func (p *Profile) GetHostname() string + func (p *Profile) GetTelemetry() string + func (p *Profile) GetToken() string + func (p *Profile) HostCache(ctx context.Context) (*HostCacheLoader, error) + func (p *Profile) Predict(args complete.Args) []string + func (p *Profile) SetDefaultOrganization(name string) *Profile + func (p *Profile) Validate() error + func (p *Profile) Write() error + func (p Profile) String() string + type RefreshResult struct + DataIfNew []byte + Err error + LastModified *time.Time