Documentation
¶
Index ¶
- func ConvertToActions(i interface{}) ([]string, error)
- func ConvertToComponent(name string, i interface{}) (component.Component, error)
- func ConvertToGVKs(name string, i interface{}) ([]schema.GroupVersionKind, error)
- func ConvertToItems(name string, i interface{}) ([]component.FlexLayoutItem, error)
- func ConvertToSections(name string, i interface{}) ([]component.SummarySection, error)
- func CreateHTTPClientObject(vm *goja.Runtime, this *goja.Object) goja.Value
- func CreateRuntimeLoop(ctx context.Context, logName string) (*eventloop.EventLoop, error)
- func DefaultFunctions(octantClient OctantClient, wsClient event.WSClientGetter) []octant.DashboardClientFunction
- func ExtractDefaultClass(vm *goja.Runtime) (*goja.Object, error)
- type DashboardDelete
- type DashboardGet
- type DashboardList
- type DashboardRefPath
- type DashboardSendEvent
- type DashboardUpdate
- type ModularDashboardClientFactory
- type OctantClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertToActions ¶
ConvertToActions attempts to convert interface i to a list of action names.
func ConvertToComponent ¶
ConvertToComponent attempts to convert interface i to a Component.
func ConvertToGVKs ¶
func ConvertToGVKs(name string, i interface{}) ([]schema.GroupVersionKind, error)
ConvertToGVKs attempts to convert interface i to a list of GroupVersionKind.
func ConvertToItems ¶
func ConvertToItems(name string, i interface{}) ([]component.FlexLayoutItem, error)
ConvertToItems attempts to convert interface i to a list of FlexLayoutItem.
func ConvertToSections ¶
func ConvertToSections(name string, i interface{}) ([]component.SummarySection, error)
ConvertToSections attempts to convert interface i to a list of SummarySection.
func CreateHTTPClientObject ¶
CreateHTTPClientObject creates an object that wraps HTTP client calls and exposes them as methods to be used in the JavaScript runtime.
func CreateRuntimeLoop ¶
CreateRuntimeLoop creates and starts a new EventLoop. An EventLoop contains a JavaScript runtime. The runtime for an EventLoop should never be accessed from outside the the loop. You can safely nest RunOnLoop calls.
func DefaultFunctions ¶
func DefaultFunctions(octantClient OctantClient, wsClient event.WSClientGetter) []octant.DashboardClientFunction
DefaultFunctions are the default functions for the ModularDashboardClientFactory.
func ExtractDefaultClass ¶
ExtractDefaultClass extracts the `default` class from the JavaScript runtime. By convention Octant plugins export a class that satisfies the JavaScript plugin interface as `default`. More information: https://www.typescriptlang.org/docs/handbook/modules.html#default-exports
Types ¶
type DashboardDelete ¶
type DashboardDelete struct {
// contains filtered or unexported fields
}
DashboardDelete is a function for deleting an object by key.
func NewDashboardDelete ¶
func NewDashboardDelete(storage octant.Storage) *DashboardDelete
NewDashboardDelete creates an instance of DashboardDelete.
func (*DashboardDelete) Call ¶
func (d *DashboardDelete) Call(ctx context.Context, vm *goja.Runtime) func(c goja.FunctionCall) goja.Value
Call creates a function call that deletes an object by key. If the key is invalid, or if the delete is unsuccessful, it will throw a javascript exception.
func (*DashboardDelete) Name ¶
func (d *DashboardDelete) Name() string
Name returns the name of this function. It will always return "Delete".
type DashboardGet ¶
type DashboardGet struct {
// contains filtered or unexported fields
}
DashboardGet is a function that gets an object by key.
func NewDashboardGet ¶
func NewDashboardGet(storage octant.Storage) *DashboardGet
NewDashboardGet creates an instance of DashboardGet.
func (*DashboardGet) Call ¶
func (d *DashboardGet) Call(ctx context.Context, vm *goja.Runtime) func(c goja.FunctionCall) goja.Value
Call creates a function call that gets an object by key. If the key is invalid, or if the get is unsuccessful, it will throw a javascript exception.
func (*DashboardGet) Name ¶
func (d *DashboardGet) Name() string
Name returns the name of this function. It will always return "Get".
type DashboardList ¶
type DashboardList struct {
// contains filtered or unexported fields
}
DashboardList is a function that lists objects by key.
func NewDashboardList ¶
func NewDashboardList(storage octant.Storage) *DashboardList
NewDashboardList creates an instance of DashboardList.
func (*DashboardList) Call ¶
func (d *DashboardList) Call(ctx context.Context, vm *goja.Runtime) func(c goja.FunctionCall) goja.Value
Call creates a function call that lists objects by key. If the key is invalid, or if the list is unsuccessful, it will throw a javascript exception.
func (*DashboardList) Name ¶
func (d *DashboardList) Name() string
Name returns the name of this function. It will always return "List".
type DashboardRefPath ¶
type DashboardRefPath struct {
// contains filtered or unexported fields
}
DashboardRefPath is a function that returns the path for a ref.
func NewDashboardRefPath ¶
func NewDashboardRefPath(linkGenerator octant.LinkGenerator) *DashboardRefPath
NewDashboardRefPath creates an instance of DashboardRefPath.
func (*DashboardRefPath) Call ¶
func (d *DashboardRefPath) Call(_ context.Context, vm *goja.Runtime) func(c goja.FunctionCall) goja.Value
Call create a function call generates a path for a ref. If the operation is unsuccessful, it will throw a javascript exception.
func (*DashboardRefPath) Name ¶
func (d *DashboardRefPath) Name() string
Name returns the name of this function. It will always return "RefPath".
type DashboardSendEvent ¶ added in v0.16.0
type DashboardSendEvent struct {
WebsocketClientManager event.WSClientGetter
}
DashboardList is a function that lists objects by key.
func NewDashboardSendEvent ¶ added in v0.16.0
func NewDashboardSendEvent(websocketClientManager event.WSClientGetter) *DashboardSendEvent
NewDashboardSendEvent creates an instance of DashboardSendEvent.
func (*DashboardSendEvent) Call ¶ added in v0.16.0
func (d *DashboardSendEvent) Call(ctx context.Context, vm *goja.Runtime) func(c goja.FunctionCall) goja.Value
Call creates a function call that sends an event to a websocket client. If no ClientID is provided or the clientID cannot be found a javascript exception is raised.
func (*DashboardSendEvent) Name ¶ added in v0.16.0
func (d *DashboardSendEvent) Name() string
Name returns the name of this function. It will always return "SendEvent".
type DashboardUpdate ¶
type DashboardUpdate struct {
// contains filtered or unexported fields
}
DashboardUpdate is a function that updates YAML. The text can send one or more objects.
func NewDashboardUpdate ¶
func NewDashboardUpdate(storage octant.Storage) *DashboardUpdate
NewDashboardUpdate creates an instance of DashboardUpdate.
func (*DashboardUpdate) Call ¶
func (d *DashboardUpdate) Call(ctx context.Context, vm *goja.Runtime) func(c goja.FunctionCall) goja.Value
Call create a function call that sends YAML to the Kubernetes cluster. If the the cluster rejects the YAML, it will throw a javascript exception.
func (*DashboardUpdate) Name ¶
func (d *DashboardUpdate) Name() string
Name returns the name of this function. It will always return "Update".
type ModularDashboardClientFactory ¶
type ModularDashboardClientFactory struct {
// contains filtered or unexported fields
}
ModularDashboardClientFactory is a modular octant.DashboardClientFactory. It configures itself based on functions passed when it is initialized.
func NewModularDashboardClientFactory ¶
func NewModularDashboardClientFactory(functions []octant.DashboardClientFunction) *ModularDashboardClientFactory
NewModularDashboardClientFactory creates an instance of ModularDashboardClientFactory.
type OctantClient ¶
type OctantClient interface { octant.LinkGenerator octant.Storage }
OctantClient is a client for interacting with Octant.