Documentation ¶
Index ¶
- Constants
- type Kubeconfig
- func (kc *Kubeconfig) Debug() *Kubeconfig
- func (kc *Kubeconfig) GetConfig() string
- func (kc *Kubeconfig) GetConfigBytes() ([]byte, error)
- func (kc *Kubeconfig) GetPath() string
- func (kc *Kubeconfig) GetYaml() string
- func (kc *Kubeconfig) Load() *Kubeconfig
- 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
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) Debug ¶
func (kc *Kubeconfig) Debug() *Kubeconfig
Return a display of the current object ex:
kc.Debug()
func (*Kubeconfig) GetConfig ¶
func (kc *Kubeconfig) GetConfig() string
Get the native kubeconfig object ex:
kc := NewKubeConfig().Get()
func (*Kubeconfig) GetConfigBytes ¶
func (kc *Kubeconfig) GetConfigBytes() ([]byte, error)
Get the native kubeconfig object returned in bytes ex:
kc := NewKubeConfig().GetConfigBytes()
func (*Kubeconfig) GetPath ¶
func (kc *Kubeconfig) GetPath() string
Get the path to the kubeconfig object returned in yaml ex:
kc := NewKubeConfig().GetPath()
func (*Kubeconfig) GetYaml ¶
func (kc *Kubeconfig) GetYaml() string
Get the native kubeconfig object returned in yaml ex:
kc := NewKubeConfig().GetYaml()
func (*Kubeconfig) Load ¶
func (kc *Kubeconfig) Load() *Kubeconfig
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)