Documentation ¶
Index ¶
- Constants
- Variables
- func AddNamespace()
- func Commit(doBackup bool)
- func Debug(v ...interface{})
- func DeleteContext(deleteContext string) bool
- func Directory()
- func Error(v ...interface{})
- func Fatal(v ...interface{})
- func Info(v ...interface{})
- func ListDefaultContexts() (contexts []string, currentContext string)
- func MergeContexts(newConfig *Config)
- func NoArgsRun()
- func OneFile()
- func PasteFromClipboard()
- func ReadDefaultConfig()
- func RemoveContext()
- func Warn(v ...interface{})
- type Cluster
- type Config
- type Context
- type Exec
- type NamedCluster
- type NamedContext
- type NamedUser
- type Preferences
- type User
Constants ¶
View Source
const ( NoArgs = iota Dir File Paste Remove NS )
View Source
const KONTEXT_FILE = "KONTEXT_FILE"
Variables ¶
View Source
var Args struct { Paste bool `short:"p" long:"paste" description:"Adds context from clipboard"` File string `short:"f" long:"file" description:"Adds the context from the given FILE" value-name:"FILE"` Dir string `short:"d" long:"directory" description:"Adds the contexts from yaml files in the given DIR" value-name:"DIR"` Remove string `short:"r" long:"remove" description:"Removes the given CONTEXT-NAME from the config" value-name:"CONTEXT-NAME"` NS string `short:"n" long:"namespace" description:"Sets the given NAMESPACE as the default ns" value-name:"NAMESPACE"` }
View Source
var CLEAR = "\033[0m"
View Source
var CMD = NoArgs
View Source
var DefaultConfigFileName string
View Source
var GREEN = "\033[32m"
View Source
var IS_DEBUG = true
View Source
var RED = "\033[31m"
View Source
var YELLOW = "\033[33m "
Functions ¶
func AddNamespace ¶
func AddNamespace()
func DeleteContext ¶
func ListDefaultContexts ¶
func MergeContexts ¶
func MergeContexts(newConfig *Config)
func PasteFromClipboard ¶
func PasteFromClipboard()
func ReadDefaultConfig ¶
func ReadDefaultConfig()
func RemoveContext ¶
func RemoveContext()
Types ¶
type Config ¶
type Config struct { ApiVersion string `yaml:"apiVersion"` Kind string `yaml:"kind"` Preferences Preferences `yaml:"preferences"` Clusters []NamedCluster `yaml:"clusters,omitempty"` Contexts []NamedContext `yaml:"contexts"` CurrentContext string `yaml:"current-context"` Users []NamedUser `yaml:"users"` }
var DefaultConfig *Config
func ReadConfig ¶
type NamedCluster ¶
func GetClusterByName ¶
func GetClusterByName(cName string, config *Config) *NamedCluster
type NamedContext ¶
func GetContextByName ¶
func GetContextByName(cName string, config *Config) *NamedContext
type NamedUser ¶
func GetUserByName ¶
type Preferences ¶
type Preferences struct { }
type User ¶
type User struct { Token string `yaml:"token,omitempty"` ClientCertificate string `yaml:"client-certificate,omitempty"` ClientKey string `yaml:"client-key,omitempty"` ClientCertificateData string `yaml:"client-certificate-data,omitempty"` ClientKeyData string `yaml:"client-key-data,omitempty"` *Exec `yaml:"exec,omitempty"` }
Click to show internal directories.
Click to hide internal directories.