Documentation
¶
Index ¶
- Variables
- func AddProfile(name string, profile types.Profile) error
- func Fetch(endpoint string) error
- func GetCredentialsWithProfile(profileName string) (*types.Credentials, error)
- func GetCurrentCredentials() (*types.Credentials, error)
- func GetDefaultProfile() (string, error)
- func GetProfile(name string) (*types.Profile, error)
- func GetProfileOrigins(profileName string) (apiOrigin, registryOrigin string, err error)
- func ListProfiles() (map[string]types.Profile, string, error)
- func RemoveCurrentCredentials() error
- func RemoveProfile(name string) error
- func SetCurrentCredentials(token string) error
- func SetDefaultProfile(name string) error
- type OriginConfig
Constants ¶
This section is empty.
Variables ¶
var ( ErrCredentialsNotFound = errors.New("credentials not found") ErrProfileNotFound = errors.New("profile not found") )
var (
ErrNoBrowser = errors.New("no browser could be found")
)
Functions ¶
func AddProfile ¶ added in v0.117.0
AddProfile adds or updates a profile in the config file
func GetCredentialsWithProfile ¶ added in v0.117.0
func GetCredentialsWithProfile(profileName string) (*types.Credentials, error)
GetCredentialsWithProfile retrieves credentials with the following priority: 1. Environment variables (REPLICATED_API_TOKEN) 2. Named profile (if profileName is provided) 3. Default profile from config file (if profileName is empty) 4. Legacy single token from config file (backward compatibility)
func GetCurrentCredentials ¶
func GetCurrentCredentials() (*types.Credentials, error)
func GetDefaultProfile ¶ added in v0.117.0
GetDefaultProfile returns the name of the default profile
func GetProfile ¶ added in v0.117.0
GetProfile retrieves a specific profile by name
func GetProfileOrigins ¶ added in v0.117.0
GetProfileOrigins returns the API and registry origins for a given profile Returns empty strings if profile doesn't exist or doesn't specify origins
func ListProfiles ¶ added in v0.117.0
ListProfiles returns all profiles and the default profile name
func RemoveCurrentCredentials ¶ added in v0.59.0
func RemoveCurrentCredentials() error
func RemoveProfile ¶ added in v0.117.0
RemoveProfile removes a profile from the config file
func SetCurrentCredentials ¶
func SetDefaultProfile ¶ added in v0.117.0
SetDefaultProfile sets the default profile
Types ¶
type OriginConfig ¶ added in v0.117.0
type OriginConfig struct {
VendorAPI string
VendorWeb string
Registry string
Linter string
KurlSH string
UsingNamespace bool
}
OriginConfig holds the resolved origins for all services
func ResolveOrigins ¶ added in v0.117.0
func ResolveOrigins(profile types.Profile) OriginConfig
ResolveOrigins resolves all service origins from a profile If the profile has a namespace, it generates okteto URLs Otherwise, it uses explicit origins or defaults
func ResolveOriginsFromProfileName ¶ added in v0.117.0
func ResolveOriginsFromProfileName(profileName string) (OriginConfig, error)
ResolveOriginsFromProfileName is a convenience function that loads a profile and resolves its origins