Documentation
¶
Index ¶
- func KlusterDetails(klusterName string) (*model.KlusterDetails, error)
- func Klusters() (*model.KlusterList, error)
- func ReadFile(src string) ([]string, error)
- func ToString(lines []string) string
- func WriteLinesToFile(dest string, lines []string) error
- type ExecResponse
- type GHRelease
- type K3sVersionInfo
- type KubeConfigFile
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func KlusterDetails ¶
func KlusterDetails(klusterName string) (*model.KlusterDetails, error)
KlusterDetails gets the details of the kluster named klusterName
func Klusters ¶
func Klusters() (*model.KlusterList, error)
Klusters lists all the available klusters
func WriteLinesToFile ¶
WriteLinesToFile write the list of lines to file dest
Types ¶
type ExecResponse ¶
type ExecResponse struct { Command string StdOut bytes.Buffer StdErr bytes.Buffer StdOutErrLines []string }
func NewExecUtil ¶
func NewExecUtil() *ExecResponse
NewExecUtil returns a new exec utility to exec native process
func (*ExecResponse) Execute ¶
func (execResponse *ExecResponse) Execute(commandArgs []string) error
Execute executes the commands with launchArgs as parameters
type GHRelease ¶
type GHRelease struct { TagName string `json:"tag_name"` Draft bool `json:"draft,omitempty"` PreRelease bool `json:"prerelease,omitempty"` }
GHRelease struct to hold the GH release info like tag and release type
type K3sVersionInfo ¶
type K3sVersionInfo struct { Versions []string CacheFile string FromCache bool ExpiryTime time.Duration }
func NewK3sVersionUtil ¶
func NewK3sVersionUtil(cacheFile string, expiryTime string) (*K3sVersionInfo, error)
NewK3sVersionUtil returns a new instance of K3sVersionInfo
func (*K3sVersionInfo) QueryAndCacheK3sReleases ¶
func (k3sv *K3sVersionInfo) QueryAndCacheK3sReleases() error
QueryAndCacheK3sReleases queries the k3s releases via GitHub API and cache the release in a file $HOME/.kluster/cache/k3s-releases
type KubeConfigFile ¶
type KubeConfigFile struct { FilePath string Config *clientcmdapi.Config }
func NewKubeConfigUtil ¶
func NewKubeConfigUtil(filePath string) (*KubeConfigFile, error)
NewKubeConfigUtil instantiates a new utility to manipulate Kube Config
func (*KubeConfigFile) LoadKubeConfig ¶
func (k *KubeConfigFile) LoadKubeConfig(configFiles ...string) error
LoadKubeConfig load the Kubeconfig file
func (*KubeConfigFile) RemoveEntriesFromKubeConfig ¶
func (k *KubeConfigFile) RemoveEntriesFromKubeConfig(klusterName string) error
RemoveEntriesFromKubeConfig Removes the entries from kubeconfig clusters etc.,
func (*KubeConfigFile) WriteKubeConfig ¶
func (k *KubeConfigFile) WriteKubeConfig(profileName string, kluster *model.Kluster) error
WriteKubeConfig writes the kubeconfig content of the cluster klusterName to file kubeConfigFile
func (*KubeConfigFile) WriteToFile ¶
func (k *KubeConfigFile) WriteToFile() error