runtime

package
v1.105.0 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2024 License: Apache-2.0 Imports: 5 Imported by: 92,553

Documentation

Overview

Package runtime provides the APIs used by code generated by the `jsii-pacmak` tool to interact with the `@jsii/kernel` process. It is not intended for users to directly interact with, and doing so could result in incorrect behavior.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create

func Create(fqn FQN, args []interface{}, inst 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{})

Get reads a property value on a given jsii class instance. The response should be decoded into the expected type of the property being read.

func InitJsiiProxy

func InitJsiiProxy(ptr interface{})

InitJsiiProxy initializes a jsii proxy instance at the provided pointer. Panics if the pointer cannot be initialized to a proxy instance (i.e: the element of it is not a registered jsii interface or class type).

func Invoke

func Invoke(obj interface{}, method string, args []interface{}, ret interface{})

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

func InvokeVoid

func InvokeVoid(obj interface{}, method string, args []interface{})

InvokeVoid will call a void method on a jsii class instance.

func IsAnonymousProxy added in v1.66.0

func IsAnonymousProxy(v interface{}) bool

IsAnonymousProxy tells whether the value v is an anonymous object proxy, or a pointer to one.

func Load

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

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

func RegisterClass

func RegisterClass(fqn FQN, class reflect.Type, members []Member, maker func() interface{})

RegisterClass associates a class fully qualified name to the specified class interface, member list, and proxy maker function. Panics if class is not a go interface, or if the provided fqn was already used to register a different type.

func RegisterEnum

func RegisterEnum(fqn FQN, enum reflect.Type, members map[string]interface{})

RegisterEnum associates an enum's fully qualified name to the specified enum type, and members. Panics if enum is not a reflect.String type, any value in the provided members map is of a type other than enum, or if the provided fqn was already used to register a different type.

func RegisterInterface

func RegisterInterface(fqn FQN, iface reflect.Type, members []Member, maker func() interface{})

RegisterInterface associates an interface's fully qualified name to the specified interface type, member list, and proxy maker function. Panics if iface is not an interface, or if the provided fqn was already used to register a different type.

func RegisterStruct

func RegisterStruct(fqn FQN, strct reflect.Type)

RegisterStruct associates a struct's fully qualified name to the specified struct type. Panics if strct is not a struct, or if the provided fqn was already used to register a different type.

func RegisterStructValidator added in v1.66.0

func RegisterStructValidator(strct reflect.Type, validator func(interface{}, func() string) error)

RegisterStructValidator adds a validator function to an already registered struct type. This is separate call largely to maintain backwards compatibility with existing code.

func Set

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

Set writes a property on a given jsii class instance. The value should match the type of the property being written, or the jsii kernel will crash.

func StaticGet

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

StaticGet reads a static property value on a given jsii class. The response should be decoded into the expected type of the property being read.

func StaticInvoke

func StaticInvoke(fqn FQN, method string, args []interface{}, ret interface{})

StaticInvoke will call a static method on a given jsii class. The response will be decoded into the expected return type for the method being called.

func StaticInvokeVoid

func StaticInvokeVoid(fqn FQN, method string, args []interface{})

StaticInvokeVoid will call a static void method on a given jsii class.

func StaticSet

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

StaticSet writes a static property on a given jsii class. The value should match the type of the property being written, or the jsii kernel will crash.

func ValidateStruct added in v1.66.0

func ValidateStruct(v interface{}, d func() string) error

ValidateStruct runs validations on the supplied struct to determine whether it is valid. In particular, it checks union-typed properties to ensure the provided value is of one of the allowed types.

Types

type FQN

type FQN api.FQN

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

type Member

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

Member is a runtime descriptor for a class or interface member

type MemberMethod

type MemberMethod api.MethodOverride

MemberMethod is a runtime descriptor for a class method (implementation of Member)

type MemberProperty

type MemberProperty api.PropertyOverride

MemberProperty is a runtime descriptor for a class or interface property (implementation of Member)

Jump to

Keyboard shortcuts

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