Documentation ¶
Index ¶
- Constants
- type Kubeconfig
- func (kc *Kubeconfig) Connect(exit bool) error
- func (kc *Kubeconfig) Debug() *Kubeconfig
- func (kc *Kubeconfig) Disconnect(exit bool) error
- func (kc *Kubeconfig) Get() string
- func (kc *Kubeconfig) GetConfig() string
- func (kc *Kubeconfig) GetConfigBytes() ([]byte, error)
- func (kc *Kubeconfig) GetConfigString() string
- func (kc *Kubeconfig) GetPath() string
- func (kc *Kubeconfig) GetYaml() string
- func (kc *Kubeconfig) Load(exit bool) error
- func (kc *Kubeconfig) LoadFromEnv(fatal bool) (*Kubeconfig, error)
- func (kc *Kubeconfig) LoadFromFile(filePath string) (*Kubeconfig, error)
- func (kc *Kubeconfig) LoadFromHome() (*Kubeconfig, error)
- func (kc *Kubeconfig) LoadFromString(yamlString string) *Kubeconfig
- func (kc *Kubeconfig) LoadFromYaml(yamlData []byte) *Kubeconfig
- func (kc *Kubeconfig) Save(exit bool) error
Constants ¶
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 ¶
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()