-
Notifications
You must be signed in to change notification settings - Fork 2
/
types.go
35 lines (30 loc) · 1014 Bytes
/
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
package main
// KubeconfigObject captures the user's ~/.kube/config file
type KubeconfigObject struct {
APIVersion string `json:"apiVersion"`
Kind string `json:"kind"`
CurrentContext string `json:"current-context"`
Contexts []ContextObject `json:"contexts"`
Users []interface{} `json:"users"`
Clusters []interface{} `json:"clusters"`
}
// ContextObject represents a single context item
type ContextObject struct {
Name string `json:"name"`
Context NestedContextObject `json:"context"`
}
// NestedContextObject contains the namespace
type NestedContextObject struct {
Cluster string `json:"cluster"`
Namespace string `json:"namespace"`
User string `json:"user"`
}
// Pod is a minimal type for a pod manifest
type Pod struct {
APIVersion string `json:"apiVersion"`
Metadata Metadata `json:"metadata"`
}
// Metadata represents the container for the name
type Metadata struct {
Name string `json:"name"`
}