Documentation ¶
Index ¶
- Variables
- func AvailablePlugins(config Config) ([]string, error)
- func ClientStateFrom(ctx context.Context) clientState
- func IsJavaScriptPlugin(pluginName string) bool
- func NewJSPlugin(ctx context.Context, pluginPath string, ...) (*jsPlugin, error)
- func Serve(service Service)
- func WithClassExtractor(pce JSClassExtractor) func(*jsPlugin)
- func WithMetadataExtractor(pme JSMetadataExtractor) func(*jsPlugin)
- func WithRuntimeFactory(prf JSRuntimeFactory) func(*jsPlugin)
- type ActionRegistrar
- type Broker
- type Capabilities
- type Client
- type ClientFactory
- type ClientState
- type ClusterClient
- type Config
- type DashboardMetadataKey
- type DefaultClientFactory
- type DefaultRunner
- type DefaultStore
- func (s *DefaultStore) ClientNames() []string
- func (s *DefaultStore) Clients() map[string]Client
- func (s *DefaultStore) Get(name string) (Client, bool)
- func (s *DefaultStore) GetCommand(name string) (string, error)
- func (s *DefaultStore) GetJS(name string) (JSPlugin, bool)
- func (s *DefaultStore) GetMetadata(name string) (*Metadata, error)
- func (s *DefaultStore) GetModuleService(name string) (ModuleService, error)
- func (s *DefaultStore) GetService(name string) (Service, error)
- func (s *DefaultStore) NamesJS() []string
- func (s *DefaultStore) Remove(name string)
- func (s *DefaultStore) RemoveJS(name string)
- func (s *DefaultStore) Store(name string, client Client, metadata *Metadata, cmd string) error
- func (s *DefaultStore) StoreJS(name string, plugin JSPlugin) error
- type Filter
- type GRPCClient
- func (c *GRPCClient) Content(ctx context.Context, contentPath string) (component.ContentResponse, error)
- func (c *GRPCClient) HandleAction(ctx context.Context, actionName string, payload action.Payload) error
- func (c *GRPCClient) Navigation(ctx context.Context) (navigation.Navigation, error)
- func (c *GRPCClient) ObjectStatus(ctx context.Context, object runtime.Object) (ObjectStatusResponse, error)
- func (c *GRPCClient) Print(ctx context.Context, object runtime.Object) (PrintResponse, error)
- func (c *GRPCClient) PrintTabs(ctx context.Context, object runtime.Object) ([]TabResponse, error)
- func (c *GRPCClient) Register(ctx context.Context, dashboardAPIAddress string) (Metadata, error)
- type GRPCServer
- func (s *GRPCServer) Content(ctx context.Context, req *dashboard.ContentRequest) (*dashboard.ContentResponse, error)
- func (s *GRPCServer) HandleAction(ctx context.Context, handleActionRequest *dashboard.HandleActionRequest) (*dashboard.HandleActionResponse, error)
- func (s *GRPCServer) Navigation(ctx context.Context, req *dashboard.NavigationRequest) (*dashboard.NavigationResponse, error)
- func (s *GRPCServer) ObjectStatus(ctx context.Context, objectRequest *dashboard.ObjectRequest) (*dashboard.ObjectStatusResponse, error)
- func (s *GRPCServer) Print(ctx context.Context, objectRequest *dashboard.ObjectRequest) (*dashboard.PrintResponse, error)
- func (s *GRPCServer) PrintTabs(ctx context.Context, objectRequest *dashboard.ObjectRequest) (*dashboard.PrintTabResponse, error)
- func (s *GRPCServer) Register(ctx context.Context, registerRequest *dashboard.RegisterRequest) (*dashboard.RegisterResponse, error)
- func (s *GRPCServer) WatchAdd(context.Context, *dashboard.WatchRequest) (*dashboard.Empty, error)
- func (s *GRPCServer) WatchDelete(context.Context, *dashboard.WatchRequest) (*dashboard.Empty, error)
- func (s *GRPCServer) WatchUpdate(context.Context, *dashboard.WatchRequest) (*dashboard.Empty, error)
- type JSClassExtractor
- type JSMetadataExtractor
- type JSOption
- type JSPlugin
- type JSRuntimeFactory
- type Manager
- func (m *Manager) Load(cmd string) (PluginConfig, error)
- func (m *Manager) ObjectStatus(ctx context.Context, object runtime.Object) (*ObjectStatusResponse, error)
- func (m *Manager) Print(ctx context.Context, object runtime.Object) (*PrintResponse, error)
- func (m *Manager) SetOctantClient(client javascript.OctantClient)
- func (m *Manager) SetStore(store ManagerStore)
- func (m *Manager) Start(ctx context.Context) error
- func (m *Manager) Stop(ctx context.Context)
- func (m *Manager) Store() ManagerStore
- func (m *Manager) Tabs(ctx context.Context, object runtime.Object) ([]component.Tab, error)
- func (m *Manager) Unload(ctx context.Context, cmd string)
- type ManagerInterface
- type ManagerOption
- type ManagerStore
- type Metadata
- type ModuleProxy
- func (ModuleProxy) AddCRD(ctx context.Context, crd *unstructured.Unstructured) error
- func (m *ModuleProxy) ClientRequestHandlers() []octant.ClientRequestHandler
- func (m *ModuleProxy) Content(ctx context.Context, contentPath string, opts module.ContentOptions) (component.ContentResponse, error)
- func (m *ModuleProxy) ContentPath() string
- func (m *ModuleProxy) Description() string
- func (ModuleProxy) Generators() []octant.Generator
- func (ModuleProxy) GroupVersionKindPath(namespace, apiVersion, kind, name string) (string, error)
- func (ModuleProxy) GvkFromPath(contentPath, namespace string) (schema.GroupVersionKind, error)
- func (m *ModuleProxy) Name() string
- func (m *ModuleProxy) Navigation(ctx context.Context, namespace, root string) ([]navigation.Navigation, error)
- func (ModuleProxy) RemoveCRD(ctx context.Context, crd *unstructured.Unstructured) error
- func (ModuleProxy) ResetCRDs(ctx context.Context) error
- func (ModuleProxy) SetContext(ctx context.Context, contextName string) error
- func (ModuleProxy) SetNamespace(namespace string) error
- func (ModuleProxy) Start() error
- func (ModuleProxy) Stop()
- func (ModuleProxy) SupportedGroupVersionKind() []schema.GroupVersionKind
- type ModuleRegistrar
- type ModuleService
- type ObjectStatusResponse
- type PluginConfig
- type PrintResponse
- type Runners
- type Service
- type ServicePlugin
- type TabResponse
Constants ¶
This section is empty.
Variables ¶
var ( // DefaultConfig is the default plugin manager configuration. DefaultConfig = &defaultConfig{os: runtime.GOOS} )
var ( // Handshake is the handshake configuration for plugins. Will // be used the dashboard and the plugin. Handshake = plugin.HandshakeConfig{ ProtocolVersion: 1, MagicCookieKey: "DASHBOARD_PLUGIN", MagicCookieValue: "dashboard", } )
var (
// Name is the name of the dashboard plugin.
Name = "plugin"
)
Functions ¶
func AvailablePlugins ¶
AvailablePlugins returns a list of available plugins.
func ClientStateFrom ¶ added in v0.20.0
func IsJavaScriptPlugin ¶ added in v0.14.0
func NewJSPlugin ¶ added in v0.14.0
func NewJSPlugin(ctx context.Context, pluginPath string, dashboardClientFactory octant.DashboardClientFactory, options ...JSOption) (*jsPlugin, error)
NewJSPlugin creates a new instances of a JavaScript plugin.
func WithClassExtractor ¶ added in v0.15.0
func WithClassExtractor(pce JSClassExtractor) func(*jsPlugin)
WithClassExtractor option replaces the default JSClassExtractor function of a JSPlugin.
func WithMetadataExtractor ¶ added in v0.15.0
func WithMetadataExtractor(pme JSMetadataExtractor) func(*jsPlugin)
WithMetadataExtractor option replaces the default JSMetadataExtractor function of a JSPlugin.
func WithRuntimeFactory ¶ added in v0.15.0
func WithRuntimeFactory(prf JSRuntimeFactory) func(*jsPlugin)
WithRuntimeFactory option replaces the default JSRuntimeFactory function of a JSPlugin.
Types ¶
type ActionRegistrar ¶
type ActionRegistrar interface { // Register registers an action. Register(actionPath string, pluginPath string, actionFunc action.DispatcherFunc) error // Unregister unregisters an action. Unregister(actionPath string, pluginPath string) }
ActionRegistrar is an action registrar.
type Broker ¶
type Broker interface { NextId() uint32 AcceptAndServe(id uint32, s func([]grpc.ServerOption) *grpc.Server) }
Broker is a Plugin Broker.
type Capabilities ¶
type Capabilities struct { // SupportsPrinterConfig are the GVKs the plugin will print configuration for. SupportsPrinterConfig []schema.GroupVersionKind `json:",omitempty"` // SupportsPrinterStatus are the GVKs the plugin will print status for. SupportsPrinterStatus []schema.GroupVersionKind `json:",omitempty"` // SupportsPrinterItems are the GVKs the plugin will print additional items for. SupportsPrinterItems []schema.GroupVersionKind `json:",omitempty"` // SupportsObjectStatus are the GVKs the plugin will generate object status for. SupportsObjectStatus []schema.GroupVersionKind `json:",omitempty"` // SupportsTab are the GVKs the plugin will create an additional tab for. SupportsTab []schema.GroupVersionKind `json:",omitempty"` // IsModule is true this plugin is a module. IsModule bool `json:",omitempty"` // ActionNames is a list of action names this plugin handles ActionNames []string `json:",omitempty"` }
Capabilities are plugin capabilities.
func (Capabilities) HasObjectStatusSupport ¶ added in v0.14.0
func (c Capabilities) HasObjectStatusSupport(gvk schema.GroupVersionKind) bool
HasObjectStatusSupport returns true if this plugins supports creating object status for the supplied GVK.
func (Capabilities) HasPrinterSupport ¶
func (c Capabilities) HasPrinterSupport(gvk schema.GroupVersionKind) bool
HasPrinterSupport returns true if this plugin supports the supplied GVK.
func (Capabilities) HasTabSupport ¶
func (c Capabilities) HasTabSupport(gvk schema.GroupVersionKind) bool
HasTabSupport returns true if this plugins supports creating a tab for the supplied GVK.
type Client ¶
type Client interface { Client() (plugin.ClientProtocol, error) Kill() }
Client is an interface that describes a plugin client.
type ClientFactory ¶
type ClientFactory interface { // Init initializes a client. Init(ctx context.Context, cmd string) Client }
ClientFactory is a factory for creating clients.
type ClientState ¶ added in v0.20.0
type ClusterClient ¶ added in v0.15.0
type ClusterClient interface { Resource(gk schema.GroupKind) (schema.GroupVersionResource, bool, error) DynamicClient() (dynamic.Interface, error) }
ClusterClient defines the cluster client plugin manager has access to.
type Config ¶
type Config interface { // PluginDirs returns the location of the plugin directories. PluginDirs(string) ([]string, error) // Home returns the user's home directory. Home() string // Fs is the afero filesystem Fs() afero.Fs // OS is the operating system OS() string }
Config is configuration for the plugin manager.
type DashboardMetadataKey ¶ added in v0.18.0
type DashboardMetadataKey string
DashboardMetadataKey is a type used for metadata keys passed by plugins
type DefaultClientFactory ¶
type DefaultClientFactory struct{}
DefaultClientFactory is the default client factory
func NewDefaultClientFactory ¶
func NewDefaultClientFactory() *DefaultClientFactory
NewDefaultClientFactory creates an instance of DefaultClientFactory.
type DefaultRunner ¶
type DefaultRunner struct {
RunFunc func(ctx context.Context, name string, gvk schema.GroupVersionKind, object runtime.Object) error
}
DefaultRunner runs a function against all plugins
func ObjectStatusRunner ¶
func ObjectStatusRunner(store ManagerStore, ch chan<- ObjectStatusResponse) DefaultRunner
ObjectStatusRunner is a runner for object status.
func PrintRunner ¶
func PrintRunner(store ManagerStore, ch chan<- PrintResponse) DefaultRunner
PrintRunner is a runner for printing.
func TabRunner ¶
func TabRunner(store ManagerStore, ch chan<- []component.Tab) DefaultRunner
TabRunner is a runner for tabs.
type DefaultStore ¶
type DefaultStore struct {
// contains filtered or unexported fields
}
DefaultStore is the default implement of ManagerStore.
func NewDefaultStore ¶
func NewDefaultStore() *DefaultStore
NewDefaultStore creates an instance of DefaultStore.
func (*DefaultStore) ClientNames ¶
func (s *DefaultStore) ClientNames() []string
ClientNames returns the client names in the store.
func (*DefaultStore) Clients ¶
func (s *DefaultStore) Clients() map[string]Client
Clients returns all the clients in the store.
func (*DefaultStore) GetCommand ¶
func (s *DefaultStore) GetCommand(name string) (string, error)
GetCommand gets the command for a plugin.
func (*DefaultStore) GetJS ¶ added in v0.14.0
func (s *DefaultStore) GetJS(name string) (JSPlugin, bool)
func (*DefaultStore) GetMetadata ¶
func (s *DefaultStore) GetMetadata(name string) (*Metadata, error)
GetMetadata gets the metadata for a plugin.
func (*DefaultStore) GetModuleService ¶ added in v0.24.0
func (s *DefaultStore) GetModuleService(name string) (ModuleService, error)
GetModuleService gets the moduleService for a plugin
func (*DefaultStore) GetService ¶
func (s *DefaultStore) GetService(name string) (Service, error)
GetService gets the service for a plugin.
func (*DefaultStore) NamesJS ¶ added in v0.14.0
func (s *DefaultStore) NamesJS() []string
func (*DefaultStore) Remove ¶ added in v0.24.0
func (s *DefaultStore) Remove(name string)
func (*DefaultStore) RemoveJS ¶ added in v0.14.0
func (s *DefaultStore) RemoveJS(name string)
type GRPCClient ¶
type GRPCClient struct {
// contains filtered or unexported fields
}
GRPCClient is the dashboard GRPC client.
func NewGRPCClient ¶
func NewGRPCClient(broker Broker, client dashboard.PluginClient) *GRPCClient
NewGRPCClient creates an instance of GRPCClient.
func (*GRPCClient) Content ¶
func (c *GRPCClient) Content(ctx context.Context, contentPath string) (component.ContentResponse, error)
Content returns content from a plugin.
func (*GRPCClient) HandleAction ¶
func (c *GRPCClient) HandleAction(ctx context.Context, actionName string, payload action.Payload) error
HandleAction runs an action on a plugin.
func (*GRPCClient) Navigation ¶
func (c *GRPCClient) Navigation(ctx context.Context) (navigation.Navigation, error)
Navigation returns navigation entries from a plugin.
func (*GRPCClient) ObjectStatus ¶
func (c *GRPCClient) ObjectStatus(ctx context.Context, object runtime.Object) (ObjectStatusResponse, error)
ObjectStatus gets an object status
func (*GRPCClient) Print ¶
func (c *GRPCClient) Print(ctx context.Context, object runtime.Object) (PrintResponse, error)
Print prints an object.
func (*GRPCClient) PrintTabs ¶ added in v0.18.0
func (c *GRPCClient) PrintTabs(ctx context.Context, object runtime.Object) ([]TabResponse, error)
PrintTabs creates one or more tabs for an object.
type GRPCServer ¶
type GRPCServer struct { Impl Service dashboard.UnimplementedPluginServer // contains filtered or unexported fields }
GRPCServer is the grpc server the dashboard will use to communicate with the plugin.
func (*GRPCServer) Content ¶
func (s *GRPCServer) Content(ctx context.Context, req *dashboard.ContentRequest) (*dashboard.ContentResponse, error)
Content returns content from a plugin.
func (*GRPCServer) HandleAction ¶
func (s *GRPCServer) HandleAction(ctx context.Context, handleActionRequest *dashboard.HandleActionRequest) (*dashboard.HandleActionResponse, error)
HandleAction runs an action in a plugin.
func (*GRPCServer) Navigation ¶
func (s *GRPCServer) Navigation(ctx context.Context, req *dashboard.NavigationRequest) (*dashboard.NavigationResponse, error)
Navigation returns navigation entries from a plugin.
func (*GRPCServer) ObjectStatus ¶
func (s *GRPCServer) ObjectStatus(ctx context.Context, objectRequest *dashboard.ObjectRequest) (*dashboard.ObjectStatusResponse, error)
ObjectStatus generates status for an object.
func (*GRPCServer) Print ¶
func (s *GRPCServer) Print(ctx context.Context, objectRequest *dashboard.ObjectRequest) (*dashboard.PrintResponse, error)
Print prints an object.
func (*GRPCServer) PrintTabs ¶ added in v0.18.0
func (s *GRPCServer) PrintTabs(ctx context.Context, objectRequest *dashboard.ObjectRequest) (*dashboard.PrintTabResponse, error)
PrintTabs prints one or more tabs for an object.
func (*GRPCServer) Register ¶
func (s *GRPCServer) Register(ctx context.Context, registerRequest *dashboard.RegisterRequest) (*dashboard.RegisterResponse, error)
Register register a plugin.
func (*GRPCServer) WatchAdd ¶
func (s *GRPCServer) WatchAdd(context.Context, *dashboard.WatchRequest) (*dashboard.Empty, error)
WatchAdd is called when a watched GVK has a new object added.
func (*GRPCServer) WatchDelete ¶
func (s *GRPCServer) WatchDelete(context.Context, *dashboard.WatchRequest) (*dashboard.Empty, error)
WatchDelete is called when a watched GVK has an object deleted.
func (*GRPCServer) WatchUpdate ¶
func (s *GRPCServer) WatchUpdate(context.Context, *dashboard.WatchRequest) (*dashboard.Empty, error)
WatchUpdate is called when a watched GVK has an object updated.
type JSClassExtractor ¶ added in v0.15.0
JSClassExtractor functions extract the default class from a runtime.
type JSMetadataExtractor ¶ added in v0.15.0
JSMetadataExtractor functions extract JavaScript plugin metadata from a runtime.
type JSOption ¶ added in v0.15.0
type JSOption func(*jsPlugin)
JSOption is an option that overrides a default value of a JSPlugin.
type JSPlugin ¶ added in v0.14.0
type JSPlugin interface { Close() PluginPath() string Metadata() *Metadata Register(ctx context.Context, dashboardAPIAddress string) (Metadata, error) Print(ctx context.Context, object runtime.Object) (PrintResponse, error) PrintTabs(ctx context.Context, object runtime.Object) ([]TabResponse, error) ObjectStatus(ctx context.Context, object runtime.Object) (ObjectStatusResponse, error) HandleAction(ctx context.Context, actionName string, payload action.Payload) error Content(ctx context.Context, contentPath string) (component.ContentResponse, error) }
JSPlugin interface represents a JavaScript plugin.
type JSRuntimeFactory ¶ added in v0.15.0
JSRuntimeFactory functions creates a JavaScript runtime for a JavaScript plugin.
type Manager ¶
type Manager struct { PortForwarder portforward.PortForwarder API api.API ClientFactory ClientFactory ModuleRegistrar ModuleRegistrar ActionRegistrar ActionRegistrar WSClient event.WSClientGetter Runners Runners // contains filtered or unexported fields }
Manager manages plugins
func NewManager ¶
func NewManager(apiService api.API, moduleRegistrar ModuleRegistrar, actionRegistrar ActionRegistrar, ws event.WSClientGetter, options ...ManagerOption) *Manager
NewManager creates an instance of Manager.
func (*Manager) Load ¶
func (m *Manager) Load(cmd string) (PluginConfig, error)
Load loads a plugin.
func (*Manager) ObjectStatus ¶
func (m *Manager) ObjectStatus(ctx context.Context, object runtime.Object) (*ObjectStatusResponse, error)
ObjectStatus updates the object status of an object configured from a plugin
func (*Manager) Print ¶
Print prints an object with plugins which are configured to print the objects's GVK.
func (*Manager) SetOctantClient ¶ added in v0.15.0
func (m *Manager) SetOctantClient(client javascript.OctantClient)
func (*Manager) SetStore ¶
func (m *Manager) SetStore(store ManagerStore)
SetStore sets the store for the manager.
func (*Manager) Store ¶
func (m *Manager) Store() ManagerStore
Store returns the store for the manager.
type ManagerInterface ¶
type ManagerInterface interface { // Print prints an object. Print(ctx context.Context, object runtime.Object) (*PrintResponse, error) // Tabs retrieves tabs for an object. Tabs(ctx context.Context, object runtime.Object) ([]component.Tab, error) // Store returns the manager's storage. Store() ManagerStore // ObjectStatus returns the object status ObjectStatus(ctx context.Context, object runtime.Object) (*ObjectStatusResponse, error) // SetOctantClient sets the the Octant client. SetOctantClient(octantClient javascript.OctantClient) }
ManagerInterface is an interface which represent a plugin manager.
type ManagerOption ¶
type ManagerOption func(*Manager)
ManagerOption is an option for configuring Manager.
type ManagerStore ¶
type ManagerStore interface { Store(name string, client Client, metadata *Metadata, cmd string) error StoreJS(name string, jspc JSPlugin) error Get(name string) (Client, bool) GetJS(name string) (JSPlugin, bool) Remove(name string) RemoveJS(name string) NamesJS() []string GetMetadata(name string) (*Metadata, error) GetModuleService(name string) (ModuleService, error) GetService(name string) (Service, error) GetCommand(name string) (string, error) Clients() map[string]Client ClientNames() []string }
ManagerStore is the data store for Manager.
type Metadata ¶
type Metadata struct { Name string Description string Capabilities Capabilities }
Metadata is plugin metadata.
type ModuleProxy ¶
type ModuleProxy struct { Metadata *Metadata PluginName string Service ModuleService }
ModuleProxy is a proxy that satisfies Octant module requirements. It allows plugins to behave as if they are internal modules.
func NewModuleProxy ¶
func NewModuleProxy(pluginName string, metadata *Metadata, service ModuleService) (*ModuleProxy, error)
NewModuleProxy creates a ModuleProxy instance.
func (ModuleProxy) AddCRD ¶
func (ModuleProxy) AddCRD(ctx context.Context, crd *unstructured.Unstructured) error
AddCRD is a no-op
func (*ModuleProxy) ClientRequestHandlers ¶
func (m *ModuleProxy) ClientRequestHandlers() []octant.ClientRequestHandler
func (*ModuleProxy) Content ¶
func (m *ModuleProxy) Content(ctx context.Context, contentPath string, opts module.ContentOptions) (component.ContentResponse, error)
Content returns content from the plugin. Plugins are expected to handle paths appropriately.
func (*ModuleProxy) ContentPath ¶
func (m *ModuleProxy) ContentPath() string
func (*ModuleProxy) Description ¶ added in v0.17.0
func (m *ModuleProxy) Description() string
Description returns the module's description.
func (ModuleProxy) Generators ¶
func (ModuleProxy) Generators() []octant.Generator
Generators is a no-op
func (ModuleProxy) GroupVersionKindPath ¶
func (ModuleProxy) GroupVersionKindPath(namespace, apiVersion, kind, name string) (string, error)
GroupVersionKindPath is currently a no-op. In the future this will allow plugins to handle paths for GVKs.
func (ModuleProxy) GvkFromPath ¶ added in v0.17.0
func (ModuleProxy) GvkFromPath(contentPath, namespace string) (schema.GroupVersionKind, error)
func (*ModuleProxy) Name ¶
func (m *ModuleProxy) Name() string
Name returns the module's name. It is the same as the plugin's metadata name.
func (*ModuleProxy) Navigation ¶
func (m *ModuleProxy) Navigation(ctx context.Context, namespace, root string) ([]navigation.Navigation, error)
Navigation returns navigation from the plugin.
func (ModuleProxy) RemoveCRD ¶
func (ModuleProxy) RemoveCRD(ctx context.Context, crd *unstructured.Unstructured) error
RemoveCRD is a no-op
func (ModuleProxy) ResetCRDs ¶
func (ModuleProxy) ResetCRDs(ctx context.Context) error
ResetCRDs is a no-op
func (ModuleProxy) SetContext ¶
func (ModuleProxy) SetContext(ctx context.Context, contextName string) error
SetContext is a no-op
func (ModuleProxy) SetNamespace ¶
func (ModuleProxy) SetNamespace(namespace string) error
SetNamespace is a no-op
func (ModuleProxy) SupportedGroupVersionKind ¶
func (ModuleProxy) SupportedGroupVersionKind() []schema.GroupVersionKind
SupportedGroupVersionKind is currently a no-op. In the future this will allow plugins to handle paths for GVKs.
type ModuleRegistrar ¶
type ModuleRegistrar interface { // Register registers a module. Register(mod module.Module) error // Unregister unregisters a module. Unregister(mod module.Module) }
ModuleRegistrar is a module registrar.
type ModuleService ¶
type ModuleService interface { Service Content(ctx context.Context, contentPath string) (component.ContentResponse, error) }
ModuleService is the interface that is exposed as a plugin as a module. The plugin is required to implement this interface.
type ObjectStatusResponse ¶
type ObjectStatusResponse struct { // ObjectStatus is status of an object. ObjectStatus component.PodSummary }
ObjectStatusResponse is an object status response from plugin.
type PluginConfig ¶ added in v0.24.0
type PrintResponse ¶
type PrintResponse struct { // Config is additional summary sections for configuration. Config []component.SummarySection // Status is additional summary sections for status. Status []component.SummarySection // Items are additional view components. Items []component.FlexLayoutItem }
PrintResponse is a printer response from the plugin. The dashboard will use this to the add the plugin's output to a summary view.
type Runners ¶
type Runners interface { // Print returns a runner for printing. The caller should close // the channel when they are done with it. Print(ManagerStore) (DefaultRunner, chan PrintResponse) // Tab returns a runner for tabs. The caller should close // the channel when they are done with it. Tab(ManagerStore) (DefaultRunner, chan []component.Tab) // ObjectStatus returns a runner for object status. The caller should // close the channel when they are done with it. ObjectStatus(ManagerStore) (DefaultRunner, chan ObjectStatusResponse) }
Runners is an interface that manager can call to get runners for a particular action.
type Service ¶
type Service interface { Register(ctx context.Context, dashboardAPIAddress string) (Metadata, error) Print(ctx context.Context, object runtime.Object) (PrintResponse, error) PrintTabs(ctx context.Context, object runtime.Object) ([]TabResponse, error) ObjectStatus(ctx context.Context, object runtime.Object) (ObjectStatusResponse, error) HandleAction(ctx context.Context, actionName string, payload action.Payload) error }
Service is the interface that is exposed as a plugin. The plugin is required to implement this interface.
type ServicePlugin ¶
type ServicePlugin struct { plugin.NetRPCUnsupportedPlugin Impl Service }
ServicePlugin is the GRPC plugin for Service.
func (*ServicePlugin) GRPCClient ¶
func (p *ServicePlugin) GRPCClient(ctx context.Context, broker *plugin.GRPCBroker, c *grpc.ClientConn) (interface{}, error)
GRPCClient is the plugin's GRPC client.
func (*ServicePlugin) GRPCServer ¶
func (p *ServicePlugin) GRPCServer(broker *plugin.GRPCBroker, s *grpc.Server) error
GRPCServer is the plugin's GRPC server.
type TabResponse ¶
TabResponse is a tab printer response from the plugin. The dashboard will use this to create an additional tab for an object.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
fake
Package fake is a generated GoMock package.
|
Package fake is a generated GoMock package. |
Package fake is a generated GoMock package.
|
Package fake is a generated GoMock package. |
fake
Package fake is a generated GoMock package.
|
Package fake is a generated GoMock package. |