Documentation ¶
Index ¶
- func CRDAPIVersions(crd *unstructured.Unstructured) ([]schema.GroupVersion, error)
- func CRDResourceGVKs(crd *unstructured.Unstructured) ([]schema.GroupVersionKind, error)
- type CRDPathGenFunc
- type EntriesFunc
- type Event
- type EventType
- type Generator
- type NavigationEntries
- type NavigationFactory
- type ObjectPath
- func (op *ObjectPath) AddCRD(ctx context.Context, crd *unstructured.Unstructured) error
- func (op *ObjectPath) GroupVersionKindPath(namespace, apiVersion, kind, name string) (string, error)
- func (op *ObjectPath) RemoveCRD(ctx context.Context, crd *unstructured.Unstructured) error
- func (op *ObjectPath) SupportedGroupVersionKind() []schema.GroupVersionKind
- type ObjectPathConfig
- type PathLookupFunc
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 ¶
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 EventType ¶
type EventType string
const ( // EventTypeContent is a content event. EventTypeContent EventType = "content" // EventTypeNamespaces is a namespaces events. EventTypeNamespaces EventType = "namespaces" 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 ¶
type NavigationEntries struct {}
NavigationEntries help construct navigation entries.
type NavigationFactory ¶
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 (*NavigationFactory) Generate ¶
func (nf *NavigationFactory) Generate(ctx context.Context, title string, iconName, iconSource string) (*navigation.Navigation, error)
Generate returns navigation entries.
func (*NavigationFactory) Root ¶
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 ¶
PathLookupFunc looks up paths for an object.