service

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2019 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dashboard

type Dashboard interface {
	Close() error
	List(ctx context.Context, key store.Key) ([]*unstructured.Unstructured, error)
	Get(ctx context.Context, key store.Key) (*unstructured.Unstructured, error)
	Update(ctx context.Context, object *unstructured.Unstructured) error
	PortForward(ctx context.Context, req api.PortForwardRequest) (api.PortForwardResponse, error)
	CancelPortForward(ctx context.Context, id string)
	ForceFrontendUpdate(ctx context.Context) error
}

Dashboard is the client a plugin can use to interact with Octant.

func NewDashboardClient

func NewDashboardClient(dashboardAPIAddress string) (Dashboard, error)

NewDashboardClient creates a dashboard client.

type Handler

type Handler struct {
	HandlerFuncs
	// contains filtered or unexported fields
}

Handler is the plugin service helper handler. Functions on this struct are called from Octant.

func (*Handler) Content

func (p *Handler) Content(contentPath string) (component.ContentResponse, error)

Content creates content for a given content path.

func (*Handler) HandleAction

func (p *Handler) HandleAction(payload action.Payload) error

HandleAction handles actions given a payload.

func (*Handler) Navigation

func (p *Handler) Navigation() (navigation.Navigation, error)

Navigation creates navigation.

func (*Handler) ObjectStatus

func (p *Handler) ObjectStatus(object runtime.Object) (plugin.ObjectStatusResponse, error)

ObjectStatus creates status for an object.

func (*Handler) Print

func (p *Handler) Print(object runtime.Object) (plugin.PrintResponse, error)

Print prints components for an object.

func (*Handler) PrintTab

func (p *Handler) PrintTab(object runtime.Object) (*component.Tab, error)

PrintTab prints a tab for an object.

func (*Handler) Register

func (p *Handler) Register(dashboardAPIAddress string) (plugin.Metadata, error)

Register registers a plugin with Octant.

func (*Handler) Validate

func (p *Handler) Validate() error

Validate validates Handler.

type HandlerFuncs

type HandlerFuncs struct {
	Print        func(dashboardClient Dashboard, object runtime.Object) (plugin.PrintResponse, error)
	PrintTab     func(dashboardClient Dashboard, object runtime.Object) (*component.Tab, error)
	ObjectStatus func(dashboardClient Dashboard, object runtime.Object) (plugin.ObjectStatusResponse, error)
	HandleAction func(dashboardClient Dashboard, payload action.Payload) error
	Navigation   func(dashboardClient Dashboard) (navigation.Navigation, error)
	Content      func(dashboardClient Dashboard, contentPath string) (component.ContentResponse, error)
}

HandlerFuncs are functions for configuring a plugin.

type Plugin

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

Plugin is a plugin service helper.

func Register

func Register(name, description string, capabilities *plugin.Capabilities, handlers HandlerFuncs, options ...PluginOption) (*Plugin, error)

Register registers a plugin with Octant.

func (*Plugin) Serve

func (p *Plugin) Serve()

Serve serves a plugin.

func (*Plugin) Validate

func (p *Plugin) Validate() error

Validate validates this helper.

type PluginOption

type PluginOption func(p *Plugin)

PluginOption is an option for configuring Plugin.

Jump to

Keyboard shortcuts

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