Help us shape the future of Go! Take the 2026 Go Developer Survey

cli

package
v0.4.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 8, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExecAndHandleError

func ExecAndHandleError(req *rest.Request, fn func([]byte))

ExecAndHandleError executes the request req and handles error

func GetClient

func GetClient(cfg *Configs) (*rest.RESTClient, string, error)

GetClient loads kube config and returns a kubernetes rest client

func LoadKubeConfig

func LoadKubeConfig(cfg *Configs) (*rest.Config, string, error)

LoadKubeConfig parses kube config files

Types

type Command

type Command interface {
	AddToCommand(command *cobra.Command)
}

Command is a cobra wrapper for cli

type Configs

type Configs struct {
	KubeConfig string

	CAFile   string
	CertFile string
	KeyFile  string

	BearerToken  string
	Username     string
	Password     string
	AuthInfoName string
	Namespace    string

	ClusterName string
	Context     string
	APIServer   string

	Insecure bool
}

Configs is configs struct for accessing k8s api server

func (*Configs) AddFlags

func (c *Configs) AddFlags(f *pflag.FlagSet)

AddFlags adds flags to a command line. Flags are sampled from kubectl's flags

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL