navigation

package
v0.25.1 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2022 License: Apache-2.0 Imports: 14 Imported by: 18

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CustomResourceDefinitions

func CustomResourceDefinitions(ctx context.Context, o store.Store) ([]*apiextv1.CustomResourceDefinition, bool, error)

func ListCustomResources

func ListCustomResources(
	ctx context.Context,
	crd *apiextv1.CustomResourceDefinition,
	namespace string,
	o store.Store,
	selector *labels.Set) (*unstructured.UnstructuredList, bool, error)

ListCustomResources lists all custom resources given a CRD.

Types

type EntriesHelper

type EntriesHelper struct {
	// contains filtered or unexported fields
}

EntriesHelper generates navigation entries.

func (*EntriesHelper) Add

func (neh *EntriesHelper) Add(title, suffix string, isLoading bool)

Add adds an entry.

func (*EntriesHelper) Generate

func (neh *EntriesHelper) Generate(prefix, namespace, name string) ([]Navigation, error)

Generate generates navigation entries.

type Navigation struct {
	Module      string       `json:"module,omitempty"`
	Description string       `json:"description,omitempty"`
	Title       string       `json:"title,omitempty"`
	Path        string       `json:"path,omitempty"`
	Children    []Navigation `json:"children,omitempty"`
	IconName    string       `json:"iconName,omitempty"`
	Loading     bool         `json:"isLoading"`
	CustomSvg   string       `json:"customSvg,omitempty"`
}

Navigation is a set of navigation entries.

func CRDEntries

func CRDEntries(ctx context.Context, prefix, namespace string, objectStore store.Store, wantsClusterScoped bool) ([]Navigation, bool, error)

CRDEntries generates navigation entries for CRDs.

func New

func New(title, navigationPath string, options ...Option) (*Navigation, error)

New creates a Navigation.

type Option

type Option func(*Navigation) error

Option is an option for configuring navigation.

func SetLoading

func SetLoading(isLoading bool) Option

SetLoading sets the loading status for the navigation entry.

func SetNavigationIcon

func SetNavigationIcon(name string) Option

SetNavigationIcon sets the icon for the navigation entry.

Jump to

Keyboard shortcuts

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