javascript

package
v0.16.1 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2020 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertToActions

func ConvertToActions(i interface{}) ([]string, error)

ConvertToActions attempts to convert interface i to a list of action names.

func ConvertToComponent

func ConvertToComponent(name string, i interface{}) (component.Component, error)

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

func CreateHTTPClientObject(vm *goja.Runtime, this *goja.Object) goja.Value

CreateHTTPClientObject creates an object that wraps HTTP client calls and exposes them as methods to be used in the JavaScript runtime.

func CreateRuntimeLoop

func CreateRuntimeLoop(ctx context.Context, logName string) (*eventloop.EventLoop, error)

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

func ExtractDefaultClass(vm *goja.Runtime) (*goja.Object, error)

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

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

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

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

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.

func (*ModularDashboardClientFactory) Create

Create creates a dashboard client javascript value.

type OctantClient

type OctantClient interface {
	octant.LinkGenerator
	octant.Storage
}

OctantClient is a client for interacting with Octant.

Jump to

Keyboard shortcuts

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