/
types.go
42 lines (35 loc) · 1.23 KB
/
types.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package cmd
type kubeConfig struct {
APIVersion string `yaml:"apiVersion,omitempty"`
Clusters []configCluster `yaml:"clusters,omitempty"`
Contexts []configContext `yaml:"contexts,omitempty"`
Users []configUser `yaml:"users,omitempty"`
CurrentContext string `yaml:"current-context,omitempty"`
Kind string `yaml:"kind,omitempty"`
Preferences string `yaml:"preferences,omitempty"`
}
type configCluster struct {
Cluster dataCluster `yaml:"cluster,omitempty"`
Name string `yaml:"name,omitempty"`
}
type dataCluster struct {
CertificateAuthorityData string `yaml:"certificate-authority-data,omitempty"`
Server string `yaml:"server,omitempty"`
}
type configContext struct {
Context contextData `yaml:"context,omitempty"`
Name string `yaml:"name,omitempty"`
}
type contextData struct {
Cluster string `yaml:"cluster,omitempty"`
User string `yaml:"user,omitempty"`
}
type configUser struct {
Name string `yaml:"name,omitempty"`
User userData `yaml:"user,omitempty"`
}
type userData struct {
Token string `yaml:"token,omitempty"`
Username string `yaml:"username,omitempty"`
Password string `yaml:"password,omitempty"`
}