kubeconfig

package
v0.0.21 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2024 License: GPL-3.0 Imports: 6 Imported by: 2

Documentation

Index

Constants

View Source
const (
	// GroupAPI is the group API scope use in this package
	GroupAPI = "sxlibs.k8s.startx.fr"
	// GroupName is the group name use in this package
	GroupName = "kubeconfig"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Kubeconfig

type Kubeconfig struct {
	Config string
	Path   string
	// contains filtered or unexported fields
}

Kubeconfig is a wrapper around api.Config

func NewKubeConfig

func NewKubeConfig() *Kubeconfig

Initialize a kubeconfig object ex:

kubeconfig := kc.NewKubeConfig()

func (*Kubeconfig) Connect added in v0.0.9

func (kc *Kubeconfig) Connect(exit bool) error

Connect to the cluster ex:

kc.Connect()

func (*Kubeconfig) Debug

func (kc *Kubeconfig) Debug() *Kubeconfig

Return a display of the current object ex:

kc.Debug()

func (*Kubeconfig) Disconnect added in v0.0.9

func (kc *Kubeconfig) Disconnect(exit bool) error

Disconnect from the cluster ex:

kc.Connect()

func (*Kubeconfig) Get added in v0.0.9

func (kc *Kubeconfig) Get() string

Get the kubeconfig string (alias to GetConfig) ex:

kc := NewKubeConfig().Get()

func (*Kubeconfig) GetConfig

func (kc *Kubeconfig) GetConfig() string

Get the kubeconfig string (alias to GetConfigString) ex:

kc := NewKubeConfig().GetConfig()

func (*Kubeconfig) GetConfigBytes

func (kc *Kubeconfig) GetConfigBytes() ([]byte, error)

Get the kubeconfig content returned in bytes ex:

kc := NewKubeConfig().GetConfigBytes()

func (*Kubeconfig) GetConfigString added in v0.0.9

func (kc *Kubeconfig) GetConfigString() string

Get the kubeconfig string ex:

kc := NewKubeConfig().GetConfigString()

func (*Kubeconfig) GetPath

func (kc *Kubeconfig) GetPath() string

Get the kubeconfig filepath ex:

kc := NewKubeConfig().GetPath()

func (*Kubeconfig) GetYaml

func (kc *Kubeconfig) GetYaml() string

Get the kubeconfig content returned in yaml ex:

kc := NewKubeConfig().GetYaml()

func (*Kubeconfig) Load

func (kc *Kubeconfig) Load(exit bool) error

Automatic search of an available kubeconfig ex:

kc.Load()

func (*Kubeconfig) LoadFromEnv

func (kc *Kubeconfig) LoadFromEnv(fatal bool) (*Kubeconfig, error)

Loading from the KUBECONFIG env var ex:

err := kc.LoadFromEnv()

func (*Kubeconfig) LoadFromFile

func (kc *Kubeconfig) LoadFromFile(filePath string) (*Kubeconfig, error)

Loading Kubeconfig from a file ex:

err := kc.LoadFromFile("/my/path/kubeconfig")

func (*Kubeconfig) LoadFromHome

func (kc *Kubeconfig) LoadFromHome() (*Kubeconfig, error)

Loading kubeconfig from the ~/.kube/config ex:

err := kc.LoadFromHome()

func (*Kubeconfig) LoadFromString

func (kc *Kubeconfig) LoadFromString(yamlString string) *Kubeconfig

Loading kubeconfig from a YAML string ex:

yamlString := `your YAML string here`
err := kc.LoadFromString(yamlString)

func (*Kubeconfig) LoadFromYaml

func (kc *Kubeconfig) LoadFromYaml(yamlData []byte) *Kubeconfig

Loading kubeconfig from YAML content ex:

yamlData := []byte(`your YAML data here`)
err := kc.LoadFromYaml(yamlData)

func (*Kubeconfig) Save added in v0.0.9

func (kc *Kubeconfig) Save(exit bool) error

Automatic search of an available kubeconfig ex:

kc.Load()

Jump to

Keyboard shortcuts

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