Documentation
¶
Index ¶
- Constants
- func BackupDns() ([]string, error)
- func CheckPortAvailable(port int) bool
- func CurrentAccountName() (string, error)
- func CurrentClusterName() (string, error)
- func CurrentDeviceIp() (*string, error)
- func CurrentDeviceName() (string, error)
- func DeleteDeviceContext(dName string) error
- func DevBoxJsonPath() string
- func DevBoxLockPath() string
- func EnsureAppRunning() error
- func ExecPackageCommand(cmdString string, cmd *cobra.Command) error
- func GetActiveCluster() (string, error)
- func GetAuthSession() (string, error)
- func GetAvailablePort() (int, error)
- func GetBaseURL() (string, error)
- func GetCompletionContext() (string, error)
- func GetConfigFolder() (configFolder string, err error)
- func GetConfigPath() string
- func GetCookieString(options ...fn.Option) (string, error)
- func GetDns() ([]string, error)
- func GetUserHomeDir() (string, error)
- func InsideBox() bool
- func IsLoading() (bool, error)
- func Logout() error
- func OnlyInsideBox(cmd *cobra.Command)
- func OnlyOutsideBox(cmd *cobra.Command)
- func ReadFile(name string) ([]byte, error)
- func SaveAuthSession(session string) error
- func SaveBaseURL(url string) error
- func SaveExtraData(extraData *ExtraData) error
- func SelectAccount(accountName string) error
- func SelectDevice(deviceName string) error
- func SelectEnv(ev Env) error
- func SelectEnvOnPath(ev Env, pth string) error
- func SetAccountToMainCtx(aName string) error
- func SetActiveCluster(devCluster string) error
- func SetBackupDns(dns []string) error
- func SetClusterToMainCtx(cName string) error
- func SetDns(dns []string) error
- func SetLoading(loading bool) error
- func SyncDevboxShellEnvFile(cmd *cobra.Command) error
- func WriteCompletionContext() (io.Writer, error)
- func WriteDeviceContext(dc *DeviceContext) error
- func WriteKLFile(fileObj KLFileType) error
- type CSType
- type DeviceContext
- type Env
- type EnvType
- type EnvVars
- type ExtraData
- type FileEntry
- type InfraContext
- type InfraContexts
- type KLFileType
- type MainContext
- type Mount
- type Mounts
- type NormalEnv
- type ResEnvType
- type ResType
- type Session
Constants ¶
View Source
const ( SessionFileName string = "kl-session.yaml" MainCtxFileName string = "kl-main-contexts.yaml" ExtraDataFileName string = "kl-extra-data.yaml" DeviceFileName string = "kl-device.yaml" CompleteFileName string = "kl-completion" )
View Source
const ( Res_config resType = "config" Res_secret resType = "secret" Res_mres resType = "mres" )
View Source
const (
KL_LOCK_PATH = "/home/kl/workspace/kl.lock"
)
Variables ¶
This section is empty.
Functions ¶
func CheckPortAvailable ¶
func CurrentAccountName ¶
func CurrentClusterName ¶
func CurrentDeviceIp ¶
func CurrentDeviceName ¶
func DeleteDeviceContext ¶
func DevBoxJsonPath ¶
func DevBoxJsonPath() string
func DevBoxLockPath ¶
func DevBoxLockPath() string
func EnsureAppRunning ¶
func EnsureAppRunning() error
func GetActiveCluster ¶
func GetAuthSession ¶
func GetAvailablePort ¶
func GetBaseURL ¶
func GetCompletionContext ¶
func GetConfigFolder ¶
func GetConfigPath ¶
func GetConfigPath() string
func GetUserHomeDir ¶
func OnlyInsideBox ¶
func OnlyOutsideBox ¶
func SaveAuthSession ¶
func SaveBaseURL ¶
func SaveExtraData ¶
func SelectAccount ¶
func SelectDevice ¶
func SelectEnvOnPath ¶
func SetAccountToMainCtx ¶
func SetActiveCluster ¶
func SetBackupDns ¶
func SetClusterToMainCtx ¶
func SetLoading ¶
func SyncDevboxShellEnvFile ¶
func WriteCompletionContext ¶
func WriteDeviceContext ¶
func WriteDeviceContext(dc *DeviceContext) error
func WriteKLFile ¶
func WriteKLFile(fileObj KLFileType) error
Types ¶
type DeviceContext ¶
type DeviceContext struct { DeviceName string `json:"deviceName"` // PrivateKey []byte `json:"privateKey"` DeviceIp net.IP `json:"deviceIp"` DeviceDns []string `json:"deviceDns"` SearchDomain string `json:"searchDomain"` }
func GetDeviceContext ¶
func GetDeviceContext() (*DeviceContext, error)
type Env ¶
type Env struct { Name string `json:"name"` TargetNs string `json:"targetNamespace"` SSHPort int `json:"sshPort"` ClusterName string `json:"clusterName"` }
func CurrentEnv ¶
type EnvType ¶
type EnvType struct { Key string `json:"key" yaml:"key"` Value *string `json:"value,omitempty" yaml:"value,omitempty"` ConfigRef *string `json:"configRef,omitempty" yaml:"configRef,omitempty"` SecretRef *string `json:"secretRef,omitempty" yaml:"secretRef,omitempty"` MresRef *string `json:"mresRef,omitempty" yaml:"mresRef,omitempty"` }
type EnvVars ¶
type EnvVars []EnvType
func (*EnvVars) AddResTypes ¶
func (*EnvVars) GetConfigs ¶
func (*EnvVars) GetSecrets ¶
type ExtraData ¶
type ExtraData struct { BaseUrl string `json:"baseUrl"` SelectedEnvs map[string]*Env `json:"selectedEnvs"` // DeviceDns string `json:"deviceDns"` // backupDns BackupDns []string `json:"dns"` Loading bool `json:"loading"` VpnConnected bool `json:"vpnConnected"` // TODO: don't have any idea about this field, needs to remove if not required ActiveCluster string `json:"activeCluster"` }
func GetExtraData ¶
type InfraContext ¶
type InfraContexts ¶
type InfraContexts struct { InfraContexts map[string]*InfraContext `json:"infraContexts"` ActiveContext string `json:"activeContext"` }
type KLFileType ¶
type KLFileType struct { Version string `json:"version" yaml:"version"` DefaultEnv string `json:"defaultEnv" yaml:"defaultEnv"` Packages []string `json:"packages" yaml:"packages"` EnvVars EnvVars `json:"envVars" yaml:"envVars"` Mounts Mounts `json:"mounts" yaml:"mounts"` InitScripts []string `json:"initScripts" yaml:"initScripts"` AccountName string `json:"accountName" yaml:"accountName"` }
func GetKlFile ¶
func GetKlFile(filePath string) (*KLFileType, error)
func (*KLFileType) ParseJson ¶
func (k *KLFileType) ParseJson(b []byte) error
func (*KLFileType) ToJson ¶
func (k *KLFileType) ToJson() ([]byte, error)
type MainContext ¶
type MainContext struct { AccountName string `json:"accountName"` ClusterName string `json:"clusterName"` }
func GetMainCtx ¶
func GetMainCtx() (*MainContext, error)
type ResEnvType ¶
type ResType ¶
type ResType struct { Name string `json:"name"` Env []ResEnvType `json:"env"` }
Click to show internal directories.
Click to hide internal directories.