config_registry

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyFile

func CopyFile(src, dst string) (err error)
func HardLink(src, dst string) (err error)

func New

func New() *cobra.Command

New looks at flags (excl. executable name, i.e. argv[0]) and decides which operation should be taken.

Types

type CopyOp

type CopyOp struct {
	New string
	Old string
}

CopyOp indicates intention to copy configs.

func (CopyOp) Run

func (op CopyOp) Run(_, stderr io.Writer) error

type CurrentOp

type CurrentOp struct{}

CurrentOp prints the current context

func (CurrentOp) Run

func (_op CurrentOp) Run(stdout, _ io.Writer) error

type DeleteOp

type DeleteOp struct {
	Configs []string // NAME or '.' to indicate current-context.
}

DeleteOp indicates intention to delete contexts.

func (DeleteOp) Run

func (op DeleteOp) Run(_, stderr io.Writer) error

deleteContexts deletes context entries one by one.

type ImportOp

type ImportOp struct {
	Path, Name string
}

ImportOp indicates intention to import existing kubeconf

func (ImportOp) Run

func (op ImportOp) Run(_, stderr io.Writer) error

type InitOp

type InitOp struct {
}

InitOp indicates intention to init kubeconf

func (InitOp) Run

func (op InitOp) Run(_, stderr io.Writer) error

type InteractiveSwitchOp

type InteractiveSwitchOp struct {
	SelfCmd string
}

func (InteractiveSwitchOp) Run

func (op InteractiveSwitchOp) Run(_, stderr io.Writer) error

type ListOp

type ListOp struct{}

ListOp describes listing contexts.

func (ListOp) Run

func (_ ListOp) Run(stdout, stderr io.Writer) error

type LocateOp

type LocateOp struct {
	Name string
}

LocateOp indicates intention to copy configs.

func (LocateOp) Run

func (op LocateOp) Run(stdout, _ io.Writer) error

type Op

type Op interface {
	Run(stdout, stderr io.Writer) error
}

type RenameOp

type RenameOp struct {
	New string // NAME of New context
	Old string // NAME of Old context (or '.' for current-context)
}

RenameOp indicates intention to rename contexts.

func (RenameOp) Run

func (op RenameOp) Run(_, stderr io.Writer) error

rename changes the old (NAME or '.' for current-context) to the "new" value. If the old refers to the current-context, current-context preference is also updated.

type SwitchOp

type SwitchOp struct {
	Target string // '-' for back and forth, or NAME
}

SwitchOp indicates intention to switch contexts.

func (SwitchOp) Run

func (op SwitchOp) Run(_, stderr io.Writer) error

type UnsupportedOp

type UnsupportedOp struct{ Err error }

UnsupportedOp indicates an unsupported flag.

func (UnsupportedOp) Run

func (op UnsupportedOp) Run(_, _ io.Writer) error

Jump to

Keyboard shortcuts

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