vm

package
v0.3.0-beta.1 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2023 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewContext

func NewContext(isolate *v8go.Isolate, global *v8go.ObjectTemplate) (*v8go.Context, error)

Types

type FetchOptions

type FetchOptions struct {
	Method   string            `json:"method,omitempty"`
	Headers  map[string]string `json:"headers,omitempty"`
	Insecure bool              `json:"insecure,omitempty"`
	Body     string            `json:"body,omitempty"`
}

type FetchResponse

type FetchResponse struct {
	Throw string `json:"__throw,omitempty"`
	Body  string `json:"__body,omitempty"`

	Headers    map[string]string `json:"headers,omitempty"`
	Status     int               `json:"status,omitempty"`
	StatusText string            `json:"statusText,omitempty"`
}

type GetOptions

type GetOptions struct {
	// If false will not use the cache for the request
	Cache *bool `json:"cache,omitempty"`
}

type GetResponse

type GetResponse struct {
	Throw   bool   `json:"__throw,omitempty"`
	Reason  string `json:"reason,omitempty"`
	Message string `json:"message,omitempty"`

	Object *unstructured.Unstructured `json:"object,omitempty"`
}

type ListOptions

type ListOptions struct {
	// A selector to restrict the list of returned objects by their labels.
	// Defaults to everything.
	// +optional
	LabelSelector string `json:"labelSelector,omitempty"`

	// Namespace to limit the search to
	// +optional
	Namespace string `json:"namespace,omitempty"`

	// If false will not use the cache for the request
	Cache *bool `json:"cache,omitempty"`
}

type ListResponse

type ListResponse struct {
	Throw   bool   `json:"__throw,omitempty"`
	Reason  string `json:"reason,omitempty"`
	Message string `json:"message,omitempty"`

	List []runtime.Object `json:"list,omitempty"`
}

type LogFunc

type LogFunc func(str string)

type ResourceResponse

type ResourceResponse struct {
	Throw bool `json:"__throw,omitempty"`

	Object map[string]interface{} `json:"object,omitempty"`

	Ok      bool   `json:"ok"`
	Reason  string `json:"reason,omitempty"`
	Message string `json:"message,omitempty"`
}

type VM

type VM interface {
	Context() *v8go.Context
	RunScriptWithTimeout(script string, origin string, timeout time.Duration) (*v8go.Value, error)
	RecreateContext() error
}

func NewVM

func NewVM(cachedClient cache2.Cache, uncachedClient clientpkg.Client, log LogFunc) (VM, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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