-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The types outside the command package
- Loading branch information
javier.juarez
authored and
javier.juarez
committed
May 31, 2021
1 parent
4433e75
commit 4f3a16d
Showing
1 changed file
with
66 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
package model | ||
|
||
// | ||
// Cluster configuration structure | ||
// | ||
type Cluster struct { | ||
CertificateAuthorityData string `yaml:"certificate-authority-data,omitempty"` | ||
Server string `yaml:"server,omitempty"` | ||
} | ||
|
||
type Clusters []struct { | ||
Cluster Cluster `yaml:"cluster,omitempty"` | ||
Name string `yaml:"name,omitempty"` | ||
} | ||
|
||
// | ||
// Context configuration structure | ||
// | ||
type Context struct { | ||
Cluster string `yaml:"cluster,omitempty"` | ||
Namespace string `yaml:"namespace,omitempty"` | ||
User string `yaml:"user,omitempty"` | ||
} | ||
|
||
type Contexts []struct { | ||
Context Context `yaml:"context,omitempty"` | ||
Name string `yaml:"name,omitempty"` | ||
} | ||
|
||
// | ||
// Users configuration structure | ||
// | ||
type UsersConfig struct { | ||
ClientId string `yaml:"client-id,omitempty"` | ||
ClientSecret string `yaml:"client-secret,omitempty"` | ||
IdToken string `yaml:"id-token,omitempty"` | ||
IdpIssueURL string `yaml:"idp-issuer-url,omitempty"` | ||
RefreshToken string `yaml:"refresh-token,omitempty"` | ||
} | ||
|
||
type UsersAuthProvider struct { | ||
Config UsersConfig `yaml:"config,omitempty"` | ||
Name string `yaml:"name,omitempty"` | ||
} | ||
|
||
type User struct { | ||
AuthProvider UsersAuthProvider `yaml:"auth-provider,omitempty"` | ||
} | ||
|
||
type Users []struct { | ||
Name string `yaml:"name,omitempty"` | ||
User User `yaml:"user,omitempty"` | ||
} | ||
|
||
// | ||
// KubeConfig structure | ||
// | ||
type KubeConfig struct { | ||
ApiVersion string `yaml:"apiVersion,omitempty"` | ||
Kind string `yaml:"kind,omitempty"` | ||
Preferences struct{} `yaml:"preferences,omitempty"` | ||
Clusters Clusters `yaml:"clusters,omitempty"` | ||
Contexts Contexts `yaml:"contexts,omitempty"` | ||
CurrentContext string `yaml:"current-context,omitempty"` | ||
Users Users `yaml:"users,omitempty"` | ||
} |