jsii

package module
v1.17.1 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2021 License: Apache-2.0 Imports: 13 Imported by: 541

README

JSII Go Runtime

This is the JSII runtime for go. This repository is used only for publishing the go module. The source code is managed in the main JSII repository. Refer to the go-runtime readme there for details on building and testing the module.

Documentation

Overview

NoOp module stubs out runtime functionality during development TODO: Delete once runtime client is complete and functional

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckFatalError

func CheckFatalError(e error)

func Close

func Close()

Close finalizes the runtime process, signalling the end of the execution to the jsii kernel process, and waiting for graceful termination. The best practice is to defer call thins at the beginning of the "main" function.

If a jsii client is used *after* Close was called, a new jsii kernel process will be initialized, and Close should be called again to correctly finalize that, too. This behavior is intended for use in unit/integration tests.

func Create

func Create(fqn FQN, args []interface{}, interfaces []FQN, overrides []Override, ret interface{})

Create will construct a new JSII object within the kernel runtime. This is called by jsii object constructors.

func Get

func Get(obj interface{}, property string, ret interface{}, implMap implementationMap)

func Invoke

func Invoke(obj interface{}, method string, args []interface{}, hasReturn bool, ret interface{}, implMap implementationMap)

Invoke will call a method on a jsii class instance. The response should be decoded into the expected return type for the method being called.

func InvokeStatic

func InvokeStatic(fqn FQN, method string, args []interface{}, hasReturn bool, ret interface{}, implMap implementationMap)

func Load

func Load(name string, version string, tarball []byte)

Load ensures a npm package is loaded in the jsii kernel.

func NoOpRequest

func NoOpRequest(req NoOpApiRequest)

func Set

func Set(obj interface{}, property string, value interface{})

func StaticGet

func StaticGet(fqn FQN, property string, ret interface{}, implMap implementationMap)

func StaticSet

func StaticSet(fqn FQN, property string, value interface{})

Types

type Any

type Any interface{}

type BeginRequest

type BeginRequest struct {
	Api    string        `json:"api"`
	Method *string       `json:"method"`
	Args   []interface{} `json:"args"`
	Objref objref        `json:"objref"`
	// contains filtered or unexported fields
}

type BeginResponse

type BeginResponse struct {
	Promiseid *string `json:"promise_id"`
	// contains filtered or unexported fields
}

type Callback

type Callback struct {
	Cbid   *string       `json:"cbid"`
	Cookie *string       `json:"cookie"`
	Invoke invokeRequest `json:"invoke"`
	Get    getRequest    `json:"get"`
	Set    setRequest    `json:"set"`
}

type CallbacksRequest

type CallbacksRequest struct {
	Api string `json:"api"`
	// contains filtered or unexported fields
}

type CallbacksResponse

type CallbacksResponse struct {
	Callbacks []Callback `json:"callbacks"`
	// contains filtered or unexported fields
}

type CompleteRequest

type CompleteRequest struct {
	Api    string      `json:"api"`
	Cbid   *string     `json:"cbid"`
	Err    *string     `json:"err"`
	Result interface{} `json:"result"`
	// contains filtered or unexported fields
}

type CompleteResponse

type CompleteResponse struct {
	Cbid *string `json:"cbid"`
	// contains filtered or unexported fields
}

type DelRequest

type DelRequest struct {
	Api    string `json:"api"`
	Objref objref `json:"objref"`
	// contains filtered or unexported fields
}

type DelResponse

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

type EndRequest

type EndRequest struct {
	Api       string  `json:"api"`
	Promiseid *string `json:"promise_id"`
	// contains filtered or unexported fields
}

type EndResponse

type EndResponse struct {
	Result interface{} `json:"result"`
	// contains filtered or unexported fields
}

type ErrorResponse

type ErrorResponse struct {
	Error *string `json:"error"`
	Stack *string `json:"stack"`
}

type FQN

type FQN string

FQN represents a fully-qualified type name in the jsii type system.

type InitOkResponse

type InitOkResponse struct {
	Hello string `json:"hello"`
	// contains filtered or unexported fields
}

HelloResponse?

type KernelRequest

type KernelRequest interface {
	// contains filtered or unexported methods
}

KernelRequest and KernelResponse allow creating a union of KernelRequest and KernelResponse types by defining private method implemented by a private custom type, which is embedded in all relevant types.

type KernelResponse

type KernelResponse interface {
	// contains filtered or unexported methods
}

type LoadRequest

type LoadRequest struct {
	Api     string `json:"api"`
	Name    string `json:"name"`
	Version string `json:"version"`
	Tarball string `json:"tarball"`
	// contains filtered or unexported fields
}

type LoadResponse

type LoadResponse struct {
	Assembly string  `json:"assembly"`
	Types    float64 `json:"types"`
	// contains filtered or unexported fields
}

func (*LoadResponse) UnmarshalJSON

func (r *LoadResponse) UnmarshalJSON(data []byte) error

Custom unmarshalling implementation for response structs. Creating new types is required in order to avoid infinite recursion.

type MethodOverride

type MethodOverride struct {
	Method *string `json:"method"`
	Cookie *string `json:"cookie"`
	// contains filtered or unexported fields
}

type NamingRequest

type NamingRequest struct {
	Api      string `json:"api"`
	Assembly string `json:"assembly"`
	// contains filtered or unexported fields
}

type NamingResponse

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

type NoOpApiRequest

type NoOpApiRequest struct {
	Class  string
	Method string
	Args   []string
}

type OkayResponse

type OkayResponse struct {
	Ok interface{} `json:"ok"`
}

type Override

type Override interface {
	// contains filtered or unexported methods
}

Override is a public interface implementing a private method `isOverride` implemented by the private custom type `override`. This is embedded by MethodOverride and PropertyOverride to simulate the union type of Override = MethodOverride | PropertyOverride.

type PropertyOverride

type PropertyOverride struct {
	Property *string `json:"property"`
	Cookie   *string `json:"cookie"`
	// contains filtered or unexported fields
}

type StatsRequest

type StatsRequest struct {
	Api string `json:"api"`
	// contains filtered or unexported fields
}

type StatsResponse

type StatsResponse struct {
	ObjectCount float64 `json:"object_count"`
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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