ns

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: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Cmd = &cli.Command{
	Name:      "ns",
	Usage:     "set default namespace for current context",
	ArgsUsage: "[NAMESPACE]",
	Flags: []cli.Flag{
		&cli.StringFlag{
			Name:  "kubeconfig",
			Usage: "path to kubeconfig from where export context",
		},
		&cli.StringFlag{
			Name:    "context",
			Aliases: []string{"c"},
			Usage:   "context for which you want to change namespace",
		},
	},

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

Functions

This section is empty.

Types

type Model

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

func NewModel

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

func (Model) Init

func (m Model) Init() tea.Cmd

func (Model) Update

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

func (Model) View

func (m Model) View() string

type NamespaceItem

type NamespaceItem struct {
	Name string
}

func (NamespaceItem) FilterValue

func (i NamespaceItem) FilterValue() string

func (NamespaceItem) Title

func (i NamespaceItem) Title() string

Jump to

Keyboard shortcuts

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