Documentation ¶
Index ¶
- Constants
- type ConfigFile
- type FileReader
- type KubeconfigFileReaderWriter
- func (k *KubeconfigFileReaderWriter) Bytes() ([]byte, error)
- func (k *KubeconfigFileReaderWriter) Close() error
- func (k *KubeconfigFileReaderWriter) Parse() error
- func (k *KubeconfigFileReaderWriter) Save() error
- func (k *KubeconfigFileReaderWriter) WithLoader(l FileReader) *KubeconfigFileReaderWriter
- type KubeconfigLoader
- type KubeconfigStruct
- type ReadWriteResetCloser
Constants ¶
View Source
const ( KUBECONFIG = "KUBECONFIG" KUBEDIR = ".kube" KUBEFILE = "config" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConfigFile ¶
type FileReader ¶
type FileReader interface {
Read() ([]ReadWriteResetCloser, error)
}
var (
DefaultLoader FileReader = new(KubeconfigLoader)
)
type KubeconfigFileReaderWriter ¶
type KubeconfigFileReaderWriter struct { Kubeconfig KubeconfigStruct // contains filtered or unexported fields }
func (*KubeconfigFileReaderWriter) Bytes ¶
func (k *KubeconfigFileReaderWriter) Bytes() ([]byte, error)
Bytes return bytes
func (*KubeconfigFileReaderWriter) Close ¶
func (k *KubeconfigFileReaderWriter) Close() error
Close close file
func (*KubeconfigFileReaderWriter) Parse ¶
func (k *KubeconfigFileReaderWriter) Parse() error
Parse - parse kubeconfig
func (*KubeconfigFileReaderWriter) Save ¶
func (k *KubeconfigFileReaderWriter) Save() error
Save kubeconfig
func (*KubeconfigFileReaderWriter) WithLoader ¶
func (k *KubeconfigFileReaderWriter) WithLoader(l FileReader) *KubeconfigFileReaderWriter
type KubeconfigLoader ¶
type KubeconfigLoader struct { }
func (*KubeconfigLoader) Read ¶
func (k *KubeconfigLoader) Read() ([]ReadWriteResetCloser, error)
Load load config files
type KubeconfigStruct ¶
type KubeconfigStruct struct { ApiVersion string `json:"apiVersion" yaml:"apiVersion"` Clusters []struct { Cluster struct { CertificateAuthorityData string `json:"certificate-authority-data" yaml:"certificate-authority-data"` Server string `json:"server" yaml:"server"` } `json:"cluster" yaml:"cluster"` Name string `json:"name" yaml:"name"` } `json:"clusters" yaml:"clusters"` Contexts []struct { Context struct { Cluster string `json:"cluster" yaml:"cluster"` User string `json:"user" yaml:"user"` } `json:"context" yaml:"context"` Name string `json:"name" yaml:"name"` } `json:"contexts" yaml:"contexts"` CurrentContext string `json:"current-context" yaml:"current-context"` Kind string `json:"kind" yaml:"kind"` Preferences struct { } `json:"preferences" yaml:"preferences"` Users []struct { Name string `json:"name" yaml:"name"` User struct { ClientCertificateData string `json:"client-certificate-data" yaml:"client-certificate-data"` ClientKeyData string `json:"client-key-data" yaml:"client-key-data"` } `json:"user" yaml:"user"` } `json:"users" yaml:"users"` }
type ReadWriteResetCloser ¶
type ReadWriteResetCloser interface { io.ReadWriteCloser Reset() error }
Click to show internal directories.
Click to hide internal directories.