Documentation
¶
Index ¶
Constants ¶
View Source
const ( VersionPath = "%s/version" LoginPath = "%s/login?cli=true" RedirectPath = "%s/spaces" AccessKeyPath = "%s/profile/access-keys" RefreshToken = time.Minute * 30 )
Variables ¶
View Source
var CacheFolder = ".loft"
View Source
var DefaultCacheConfig = "config.json"
DefaultCacheConfig is the path to the config
Functions ¶
func GetKubeConfig ¶
func GetKubeConfig(host, token, namespace string, insecure bool) clientcmd.ClientConfig
func VerifyVersion ¶
VerifyVersion checks if the Loft version is compatible with this CLI version
Types ¶
type Client ¶
type Client interface {
Management() (kube.Interface, error)
ManagementConfig() (*rest.Config, error)
RefreshSelf(ctx context.Context) error
Self() *managementv1.Self
Login(host string, insecure bool, log log.Logger) error
LoginWithAccessKey(host, accessKey string, insecure bool) error
LoginRaw(host, accessKey string, insecure bool) error
Logout(ctx context.Context) error
Version() (*auth.Version, error)
Config() *Config
Save() error
}
func NewClientFromConfig ¶
func NewClientFromPath ¶
type Config ¶
type Config struct {
metav1.TypeMeta `json:",inline"`
// host is the http endpoint of how to access loft
// +optional
Host string `json:"host,omitempty"`
// LastInstallContext is the last install context
// +optional
LastInstallContext string `json:"lastInstallContext,omitempty"`
// insecure specifies if the loft instance is insecure
// +optional
Insecure bool `json:"insecure,omitempty"`
// access key is the access key for the given loft host
// +optional
AccessKey string `json:"accesskey,omitempty"`
// virtual cluster access key is the access key for the given loft host to create virtual clusters
// +optional
VirtualClusterAccessKey string `json:"virtualClusterAccessKey,omitempty"`
// map of cached certificates for "access point" mode virtual clusters
// +optional
VirtualClusterAccessPointCertificates map[string]VirtualClusterCertificatesEntry
}
Config defines the client config structure
Click to show internal directories.
Click to hide internal directories.