context

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Cmd = &cli.Command{
	Name:      "ctx",
	Usage:     "context commands",
	ArgsUsage: "[CONTEXT]",
	Flags: []cli.Flag{
		&cli.StringFlag{
			Name:  "kubeconfig",
			Usage: "path to kubeconfig from where export context",
		},
	},

	Subcommands: []*cli.Command{
		mv.Cmd,
		rm.Cmd,
		ls.Cmd,
	},

	Action: func(cCtx *cli.Context) error {
		k8sContext := cCtx.Args().First()
		if k8sContext != "" {
			return directChange(cCtx, k8sContext)
		} else {
			return showTUI(cCtx)
		}
	},
}

Functions

This section is empty.

Types

type ContextItem

type ContextItem struct {
	Context *apiv1.NamedContext
	Kconf   *kconf.KubeConfig
}

func (ContextItem) Description

func (i ContextItem) Description() string

func (ContextItem) FilterValue

func (i ContextItem) FilterValue() string

func (ContextItem) Title

func (i ContextItem) Title() string

type Model

type Model struct {
	ExitMsg tea.Msg
	// contains filtered or unexported fields
}

func NewModel

func NewModel(kc *kconf.KubeConfig) (*Model, error)

func (Model) Init

func (m Model) Init() tea.Cmd

func (*Model) SwitchToCtxView

func (m *Model) SwitchToCtxView()

func (Model) Update

func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (Model) View

func (m Model) View() string

type State

type State int
const (
	ContextView State = iota
	NamespaceView
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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