cfg

package
v1.0.0-beta.4 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Fzf

func Fzf(in bytes.Buffer) (string, error)

Fzf uses fzf to display a fuzzy finder in stdout. Returns a string containing the selected item in the fzf result

func FzfListContexts

func FzfListContexts() (string, error)

func FzfListKubeconfigs

func FzfListKubeconfigs(c *Cfg) (string, error)

func RemoveContextFromKubeConfig

func RemoveContextFromKubeConfig(context string, kubeconfig *api.Config) (*api.Config, error)

Remove a context from provided kubeconfig, including it's referenced user and context

func RemoveOrphanedClustersFromKubeConfig

func RemoveOrphanedClustersFromKubeConfig(kubeconfig *api.Config) ([]string, error)

Remove orphaned clusters from provided kubeconfig

func RemoveOrphanedUsersFromKubeConfig

func RemoveOrphanedUsersFromKubeConfig(kubeconfig *api.Config) ([]string, error)

Remove orphaned users from provided kubeconfig

Types

type Cfg

type Cfg struct {
	// Cfg   *api.Config
	Path  string
	Globs []string

	SelectedItem string
	// contains filtered or unexported fields
}

func New

func New(p string, globs ...string) *Cfg

func (*Cfg) AddItem

func (c *Cfg) AddItem(name string, i *Item)

func (*Cfg) Delete

func (c *Cfg) Delete() error

func (*Cfg) GetItem

func (c *Cfg) GetItem(name string) *Item

func (*Cfg) ListItemsStr

func (c *Cfg) ListItemsStr() []string

func (*Cfg) Prune

func (c *Cfg) Prune() error

func (*Cfg) Set

func (c *Cfg) Set() error

Set creates a new symlink to a kubeconfigfile overwriting any existing one

type Item

type Item struct {
	IsSelected bool
	// contains filtered or unexported fields
}

func NewItem

func NewItem(fullPath string, c *api.Config, info os.FileInfo, title, desc string) *Item

Jump to

Keyboard shortcuts

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