Documentation
¶
Index ¶
- Constants
- Variables
- func GenerateWireGuardKeys() (wgtypes.Key, wgtypes.Key, error)
- func GetAuthSession() (string, error)
- func GetBaseURL() (string, error)
- func GetConfigFolder() (configFolder string, err error)
- func GetCookieString(options ...fn.Option) (string, error)
- func GetUserHomeDir() (string, 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
- type AccountClusterConfig
- type AccountVpnConfig
- type CSType
- type DeviceContext
- type Env
- type EnvType
- type EnvVars
- type ExtraData
- type FileClient
- type FileEntry
- type InfraContext
- type InfraContexts
- type InstallCommand
- type InstallHelmValues
- type KLFileType
- type Keys
- type MainContext
- type Mount
- type Mounts
- type NormalEnv
- type ResEnvType
- type ResType
- type Session
- type WGConfig
Constants ¶
View Source
const ( SessionFileName string = "kl-session.yaml" ExtraDataFileName string = "kl-extra-data.yaml" CompleteFileName string = "kl-completion" DeviceFileName string = "kl-device.yaml" WGConfigFileName string = "kl-wg.yaml" WorkspaceWireguardConfigFileName string = "kl-workspace-wg.conf" KLWGProxyIp = "198.18.0.1" KLHostIp = "198.18.0.2" KLWorkspaceIp = "198.18.0.3" KLWGAllowedIp = "100.64.0.0/10" HostIp = "172.18.0.2" )
View Source
const ( Res_config resType = "config" Res_secret resType = "secret" Res_mres resType = "mres" )
Variables ¶
View Source
var NoEnvSelected = fmt.Errorf("no selected environment")
Functions ¶
func GetAuthSession ¶
func GetBaseURL ¶
func GetConfigFolder ¶
func GetUserHomeDir ¶
func OnlyInsideBox ¶
func OnlyOutsideBox ¶
func SaveAuthSession ¶
func SaveBaseURL ¶
func SaveExtraData ¶
Types ¶
type AccountClusterConfig ¶
type AccountClusterConfig struct {
ClusterToken string `json:"clusterToken"`
ClusterName string `json:"cluster"`
InstallCommand InstallCommand
Installed bool
WGConfig WGConfig
}
func (*AccountClusterConfig) Marshal ¶
func (a *AccountClusterConfig) Marshal() ([]byte, error)
func (*AccountClusterConfig) Unmarshal ¶
func (a *AccountClusterConfig) Unmarshal(b []byte) error
type AccountVpnConfig ¶
func (*AccountVpnConfig) Marshal ¶
func (a *AccountVpnConfig) Marshal() ([]byte, error)
func (*AccountVpnConfig) Unmarshal ¶
func (a *AccountVpnConfig) Unmarshal(b []byte) error
type DeviceContext ¶
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"`
DnsHostSuffix string `json:"dnsHostSuffix"`
SelectedEnvs map[string]*Env `json:"selectedEnvs"`
}
func GetExtraData ¶
type FileClient ¶
type FileClient interface {
GetHostWgConfig() (string, error)
GetWGConfig() (*WGConfig, error)
SetWGConfig(config string) error
CurrentAccountName() (string, error)
Logout() error
GetVpnAccountConfig(account string) (*AccountVpnConfig, error)
SetVpnAccountConfig(account string, config *AccountVpnConfig) error
GetClusterConfig(account string) (*AccountClusterConfig, error)
SetClusterConfig(account string, accClusterConfig *AccountClusterConfig) error
GetDevice() (*DeviceContext, error)
SetDevice(device *DeviceContext) error
WriteKLFile(fileObj KLFileType) error
GetKlFile(filePath string) (*KLFileType, error)
SelectEnv(ev Env) error
SelectEnvOnPath(pth string, ev Env) error
EnvOfPath(pth string) (*Env, error)
CurrentEnv() (*Env, error)
}
func New ¶
func New() (FileClient, error)
type InfraContext ¶
type InfraContexts ¶
type InfraContexts struct {
InfraContexts map[string]*InfraContext `json:"infraContexts"`
ActiveContext string `json:"activeContext"`
}
type InstallCommand ¶
type InstallCommand struct {
ChartRepo string `json:"chart-repo"`
ChartVersion string `json:"chart-version"`
CRDsURL string `json:"crds-url"`
HelmValues InstallHelmValues
}
type InstallHelmValues ¶
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"`
Ports []int `json:"ports" yaml:"ports"`
// InitScripts []string `json:"initScripts" yaml:"initScripts"`
AccountName string `json:"accountName" yaml:"accountName"`
}
type MainContext ¶
type MainContext struct {
AccountName string `json:"accountName"`
}
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.