ui

package
v0.0.1-alpha.22 Latest Latest
Warning

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

Go to latest
Published: May 18, 2025 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewComponentManager

func NewComponentManager(logger *zap.SugaredLogger) *componentManager

Types

type Client

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

func NewClient

func NewClient(manager *componentManager) *Client

func (*Client) GetPluginComponents

func (c *Client) GetPluginComponents(
	params GetPluginComponentsInput,
) map[string][]ResourceComponent

Get all the registered components for a plugin.

func (*Client) GetResourceAreaComponent

func (c *Client) GetResourceAreaComponent(params GetResourceAreaComponentInput) *ResourceComponent

Get the preferred component to display for the resource area.

func (*Client) GetResourceComponents

func (c *Client) GetResourceComponents(params GetResourceComponentsInput) []ResourceComponent

Get all the registered components for a plugin's resource.

type GetPluginComponentsInput

type GetPluginComponentsInput struct {
	Plugin string `json:"plugin"`
}

type GetResourceAreaComponentInput

type GetResourceAreaComponentInput struct {
	Plugin   string                `json:"plugin"`
	Resource string                `json:"resource"`
	Area     ResourceComponentArea `json:"area"`
}

type GetResourceComponentsInput

type GetResourceComponentsInput struct {
	Plugin   string `json:"plugin"`
	Resource string `json:"resource"`
}

type ResourceComponent

type ResourceComponent struct {
	Owner          string                `json:"owner"     yaml:"owner"`
	Name           string                `json:"name"      yaml:"name"`
	Plugin         string                `json:"plugin"    yaml:"plugin"`
	Resource       string                `json:"resource"  yaml:"resource"`
	Area           ResourceComponentArea `json:"area"      yaml:"area"`
	ExtensionPoint string                `json:"extension" yaml:"extension"`
	Extensions     []ResourceComponent   `json:"-"         yaml:"-"`
}

ResourceComponent represents a UI component that can be displayed as part of the UI.

func (ResourceComponent) String

func (rc ResourceComponent) String() string

type ResourceComponentArea

type ResourceComponentArea string
const (
	ResourceComponentAreaSidebar ResourceComponentArea = "SIDEBAR"
	ResourceComponentAreaTable   ResourceComponentArea = "TABLE"
)

type ResourceComponentStore

type ResourceComponentStore map[string]map[string][]ResourceComponent

ResourceComponentStore keeps a nested map of plugin->resourceID->Components so the UI knows what is available to render.

func NewResourceComponentStore

func NewResourceComponentStore() ResourceComponentStore

NewResourceComponentStore creates a new ResourceComponentStore.

func (ResourceComponentStore) AddComponent

func (pcs ResourceComponentStore) AddComponent(resource ResourceComponent) error

AddComponent adds a component to the store.

func (ResourceComponentStore) AddPlugin

func (pcs ResourceComponentStore) AddPlugin(plugin string)

AddPlugin adds a plugin to the store.

func (ResourceComponentStore) GetComponentsByResource

func (pcs ResourceComponentStore) GetComponentsByResource(
	plugin string,
) map[string][]ResourceComponent

GetComponentsByPlugin returns the components for a given plugin.

func (ResourceComponentStore) GetComponentsForResource

func (pcs ResourceComponentStore) GetComponentsForResource(
	plugin, resource string,
) []ResourceComponent

GetComponents returns the components for a given plugin and resource.

func (ResourceComponentStore) RemovePlugin

func (pcs ResourceComponentStore) RemovePlugin(plugin string)

RemovePlugin removes a plugin from the store.

Jump to

Keyboard shortcuts

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