resourceMenu

package
v0.0.0-...-6c48755 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	StandardWidget WidgetConstructor = func(workspace commander.Workspace, resource *commander.Resource, format listTable.TableFormat) commander.Widget {
		return listTable.NewResourceListTable(workspace, resource, format)
	}
	CustomWidgets = map[string]WidgetConstructor{
		"Pod": func(workspace commander.Workspace, resource *commander.Resource, format listTable.TableFormat) commander.Widget {
			return pod.NewPodsList(workspace, resource, format)
		},
	}
	DefaultItems = []*pb.Resource{
		{Kind: "Namespace", Group: "", Title: "Namespaces"},
		{Kind: "Node", Group: "", Title: "Nodes"},
		{Kind: "StorageClass", Group: "storage.k8s.io", Title: "Storage"},
		{Kind: "PersistentVolume", Group: "", Title: "Volumes"},

		{Namespaced: true, Kind: "Deployment", Group: "apps", Title: "Deployments"},
		{Namespaced: true, Kind: "StatefulSet", Group: "apps", Title: "Stateful"},
		{Namespaced: true, Kind: "DaemonSet", Group: "apps", Title: "Daemons"},
		{Namespaced: true, Kind: "ReplicaSet", Group: "apps", Title: "Replicas"},
		{Namespaced: true, Kind: "Pod", Group: "", Title: "Pods"},
		{Namespaced: true, Kind: "CronJob", Group: "batch", Title: "Cron Jobs"},
		{Namespaced: true, Kind: "Job", Group: "batch", Title: "Jobs"},
		{Namespaced: true, Kind: "PersistentVolumeClaim", Group: "", Title: "PVCs"},
		{Namespaced: true, Kind: "ConfigMap", Group: "", Title: "Configs"},
		{Namespaced: true, Kind: "Secret", Group: "", Title: "Secrets"},
		{Namespaced: true, Kind: "Service", Group: "", Title: "Services"},
		{Namespaced: true, Kind: "Ingress", Group: "networking.k8s.io", Title: "Ingresses"},
		{Namespaced: true, Kind: "ServiceAccount", Group: "", Title: "ServiceAccounts"},
	}
)

Functions

This section is empty.

Types

type GroupKindFunc

type GroupKindFunc func(res *commander.Resource)

type ResourceMenu

type ResourceMenu struct {
	*listTable.ListTable
	sync.Mutex
	// contains filtered or unexported fields
}

func NewResourcesMenu

func NewResourcesMenu(workspace commander.Workspace, onSelect SelectFunc, selectNamespace func(), resourceProvider commander.ResourceProvider) (*ResourceMenu, error)

func (*ResourceMenu) ConfigUpdated

func (r *ResourceMenu) ConfigUpdated(config *pb.Config)

func (*ResourceMenu) OnKeyPress

func (r *ResourceMenu) OnKeyPress(row commander.Row, event *tcell.EventKey) bool

func (*ResourceMenu) OnShow

func (r *ResourceMenu) OnShow()

func (*ResourceMenu) SelectItem

func (r *ResourceMenu) SelectItem(id string)

func (*ResourceMenu) UpdateMenu

func (r *ResourceMenu) UpdateMenu(items []*pb.Resource) ([]commander.Operation, error)

type SelectFunc

type SelectFunc func(itemId string, widget commander.Widget) bool

type WidgetConstructor

type WidgetConstructor func(workspace commander.Workspace, resource *commander.Resource, format listTable.TableFormat) commander.Widget

Jump to

Keyboard shortcuts

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