Documentation
¶
Index ¶
- func NewComponentManager(logger *zap.SugaredLogger) *componentManager
- type Client
- type GetPluginComponentsInput
- type GetResourceAreaComponentInput
- type GetResourceComponentsInput
- type ResourceComponent
- type ResourceComponentArea
- type ResourceComponentStore
- func (pcs ResourceComponentStore) AddComponent(resource ResourceComponent) error
- func (pcs ResourceComponentStore) AddPlugin(plugin string)
- func (pcs ResourceComponentStore) GetComponentsByResource(plugin string) map[string][]ResourceComponent
- func (pcs ResourceComponentStore) GetComponentsForResource(plugin, resource string) []ResourceComponent
- func (pcs ResourceComponentStore) RemovePlugin(plugin string)
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 (*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 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.