client

package
v1.0.10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 6, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

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"
)

Variables

This section is empty.

Functions

func ActiveDns

func ActiveDns() ([]string, error)

func CurrentAccountName

func CurrentAccountName() (string, error)

func CurrentClusterName

func CurrentClusterName() (string, error)

func CurrentDeviceName

func CurrentDeviceName() (string, error)

func CurrentProjectName

func CurrentProjectName() (string, error)

func DeleteDeviceContext

func DeleteDeviceContext(dName string) error

func GetAuthSession

func GetAuthSession() (string, error)

func GetBaseURL

func GetBaseURL() (string, error)

func GetConfigFolder

func GetConfigFolder() (configFolder string, err error)

func GetConfigPath

func GetConfigPath() string

func GetCookieString

func GetCookieString(options ...fn.Option) (string, error)

func Logout

func Logout() error

func ReadFile

func ReadFile(name string) ([]byte, error)

func SaveAuthSession

func SaveAuthSession(session string) error

func SaveBaseURL

func SaveBaseURL(url string) error

func SaveExtraData

func SaveExtraData(extraData *ExtraData) error

func SelectAccount

func SelectAccount(accountName string) error

func SelectEnv

func SelectEnv(envName Env) error

func SetAccountToMainCtx

func SetAccountToMainCtx(aName string) error

func SetActiveDns

func SetActiveDns(dns []string) error

func SetClusterToMainCtx

func SetClusterToMainCtx(cName string) error

func WriteDeviceContext

func WriteDeviceContext(dName string) error

func WriteKLFile

func WriteKLFile(fileObj KLFileType) error

Types

type CSType

type CSType string
const (
	ConfigType CSType = "config"
	SecretType CSType = "secret"
)

type DeviceContext

type DeviceContext struct {
	DeviceName string `json:"deviceName"`
}

func GetDeviceContext

func GetDeviceContext() (*DeviceContext, error)

type Env

type Env struct {
	Name     string `json:"name"`
	TargetNs string `json:"targetNamespace"`
}

func CurrentEnv

func CurrentEnv() (*Env, error)

type EnvType

type EnvType struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

type ExtraData

type ExtraData struct {
	BaseUrl      string          `json:"baseUrl"`
	SelectedEnvs map[string]*Env `json:"selectedEnvs"`
	DNS          []string        `json:"dns"`
	Loading      bool            `json:"loading"`
}

func GetExtraData

func GetExtraData() (*ExtraData, error)

type FileEntry

type FileEntry struct {
	Path string `json:"path"`
	Type CSType `json:"type"`
	Name string `json:"Name"`
	Key  string `json:"key"`
}

type InfraContext

type InfraContext struct {
	Name        string `json:"name"`
	AccountName string `json:"accountName"`
	ClusterName string `json:"ClusterName"`
	DeviceName  string `json:"deviceName"`
}

type InfraContexts

type InfraContexts struct {
	InfraContexts map[string]*InfraContext `json:"infraContexts"`
	ActiveContext string                   `json:"activeContext"`
}

type KLFileType

type KLFileType struct {
	Version    string    `json:"version"`
	DefaultEnv string    `json:"defaultEnv"`
	Project    string    `json:"project"`
	Mres       []ResType `json:"mres"`
	Configs    []ResType `json:"configs"`
	Secrets    []ResType `json:"secrets"`
	Env        []EnvType `json:"env"`
	FileMount  MountType `json:"fileMount"`
}

func GetKlFile

func GetKlFile(filePath string) (*KLFileType, error)

type MainContext

type MainContext struct {
	AccountName string `json:"accountName"`
	ClusterName string `json:"clusterName"`
}

func GetMainCtx

func GetMainCtx() (*MainContext, error)

type MountType

type MountType struct {
	MountBasePath string      `json:"mountBasePath"`
	Mounts        []FileEntry `json:"mounts"`
}

type ResEnvType

type ResEnvType struct {
	Name   *string `json:"name,omitempty" yaml:"name,omitempty"`
	Key    string  `json:"key"`
	RefKey string  `json:"refKey"`
}

type ResType

type ResType struct {
	Name string       `json:"name"`
	Env  []ResEnvType `json:"env"`
}

type Session

type Session struct {
	Session string `json:"session"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL