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)
SpaceInstance(project, name string) (kube.Interface, error)
SpaceInstanceConfig(project, name string) (*rest.Config, error)
VirtualClusterInstance(project, name string) (kube.Interface, error)
VirtualClusterInstanceConfig(project, name string) (*rest.Config, error)
Cluster(cluster string) (kube.Interface, error)
ClusterConfig(cluster string) (*rest.Config, error)
VirtualCluster(cluster, namespace, virtualCluster string) (kube.Interface, error)
VirtualClusterConfig(cluster, namespace, virtualCluster string) (*rest.Config, error)
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
DirectClusterEndpointToken(forceRefresh bool) (string, error)
VirtualClusterAccessPointCertificate(project, virtualCluster string, forceRefresh bool) (string, string, error)
Save() error
}
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"`
// DEPRECATED: do not use anymore
// the direct cluster endpoint token
// +optional
DirectClusterEndpointToken string `json:"directClusterEndpointToken,omitempty"`
// DEPRECATED: do not use anymore
// last time the direct cluster endpoint token was requested
// +optional
DirectClusterEndpointTokenRequested *metav1.Time `json:"directClusterEndpointTokenRequested,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.