octant

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2019 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CRDAPIVersions

func CRDAPIVersions(crd *unstructured.Unstructured) ([]schema.GroupVersion, error)

CRDAPIVersions returns the group versions that are contained within a CRD.

func CRDResourceGVKs

func CRDResourceGVKs(crd *unstructured.Unstructured) ([]schema.GroupVersionKind, error)

CRDResourceGVKs returns the GVKs contained within a CRD.

Types

type CRDPathGenFunc

type CRDPathGenFunc func(namespace, crdName, name string) (string, error)

CRDPathGenFunc is a function that generates a custom resource path.

type EntriesFunc

type EntriesFunc func(ctx context.Context, prefix, namespace string, objectStore store.Store) ([]navigation.Navigation, error)

EntriesFunc is a function that can create navigation entries.

type Event

type Event struct {
	Type EventType
	Data []byte
	Err  error
}

Event is an event for the dash frontend.

type EventType

type EventType string
const (
	// EventTypeContent is a content event.
	EventTypeContent EventType = "content"
	// EventTypeNamespaces is a namespaces events.
	EventTypeNamespaces EventType = "namespaces"
	// EventTypeNavigation is a navigation event.
	EventTypeNavigation EventType = "navigation"
	// EventTypeObjectNotFound is an object not found event.
	EventTypeObjectNotFound EventType = "objectNotFound"
)

type Generator

type Generator interface {
	// Event generates events using the returned channel.
	Event(ctx context.Context) (Event, error)

	// ScheduleDelay is how long to wait before scheduling this generator again.
	ScheduleDelay() time.Duration

	// Name is the generator name.
	Name() string
}

Generator generates events.

type NavigationEntries struct {
	Lookup       map[string]string
	EntriesFuncs map[string]EntriesFunc
	Order        []string
}

NavigationEntries help construct navigation entries.

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

NavigationFactory generates navigation entries.

func NewNavigationFactory

func NewNavigationFactory(namespace string, root string, objectStore store.Store, entries NavigationEntries) *NavigationFactory

NewNavigationFactory creates an instance of NewNavigationFactory.

func (nf *NavigationFactory) Generate(ctx context.Context, title string, iconName, iconSource string) (*navigation.Navigation, error)

Generate returns navigation entries.

func (nf *NavigationFactory) Root() string

Root returns the rootPath of the navigation tree.

type ObjectPath

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

ObjectPath contains functions for generating paths for an object. Typically this is a helper which can be embedded in modules.

func NewObjectPath

func NewObjectPath(config ObjectPathConfig) (*ObjectPath, error)

NewObjectPath creates ObjectPath.

func (*ObjectPath) AddCRD

func (op *ObjectPath) AddCRD(ctx context.Context, crd *unstructured.Unstructured) error

AddCRD adds support for a CRD to the ObjectPath.

func (*ObjectPath) GroupVersionKindPath

func (op *ObjectPath) GroupVersionKindPath(namespace, apiVersion, kind, name string) (string, error)

GroupVersionKind returns a path for an object.

func (*ObjectPath) RemoveCRD

func (op *ObjectPath) RemoveCRD(ctx context.Context, crd *unstructured.Unstructured) error

RemoveCRD removes support for a CRD from the ObjectPath.

func (*ObjectPath) SupportedGroupVersionKind

func (op *ObjectPath) SupportedGroupVersionKind() []schema.GroupVersionKind

SupportedGroupVersionKind returns a slice of GVKs this object path can handle.

type ObjectPathConfig

type ObjectPathConfig struct {
	ModuleName     string
	SupportedGVKs  []schema.GroupVersionKind
	PathLookupFunc PathLookupFunc
	CRDPathGenFunc CRDPathGenFunc
}

ObjectPathConfig is configuration for ObjectPath.

func (*ObjectPathConfig) Validate

func (opc *ObjectPathConfig) Validate() error

Validate returns an error if the configuration is invalid.

type PathLookupFunc

type PathLookupFunc func(namespace, apiVersion, kind, name string) (string, error)

PathLookupFunc looks up paths for an object.

Jump to

Keyboard shortcuts

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