jsii

package module
v1.99.0 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2024 License: Apache-2.0 Imports: 6 Imported by: 463

README

jsii

The jsii runtime library for Go

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.

⚖ License

jsii is distributed under the Apache License, Version 2.0.

See LICENSE and NOTICE for more information.

Documentation

Overview

Package jsii provides utilities that user code can leverage to facilitate working with libraries generated by the `jsii-pacmak` tool. This includes type conversion helpers as well as utilities to manage the runtime process' lifecycle.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bool added in v1.26.0

func Bool(v bool) *bool

Bool returns a pointer to the provided bool.

func Bools added in v1.27.1

func Bools(v ...bool) *[]*bool

Bools returns a pointer to a slice of pointers to all of the provided booleans.

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 this at the beginning of the "main" function.

func Create deprecated

func Create(fqn FQN, args []interface{}, inst interface{})

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

func Get deprecated

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

Deprecated: 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 deprecated added in v1.23.0

func InitJsiiProxy(ptr interface{})

Deprecated: 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 deprecated

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

Deprecated: 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 deprecated added in v1.24.0

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

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

func Load deprecated

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

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

func Number added in v1.26.0

func Number[T numberType](v T) *float64

Number returns a pointer to the provided float64.

func Numbers added in v1.27.1

func Numbers[T numberType](v ...T) *[]*float64

Numbers returns a pointer to a slice of pointers to all of the provided numbers.

func Ptr added in v1.79.0

func Ptr[T basicType](v T) *T

Ptr returns a pointer to the provided value.

func PtrSlice added in v1.79.0

func PtrSlice[T basicType](v ...T) *[]*T

PtrSlice returns a pointer to a slice of pointers to all of the provided values.

func RegisterClass deprecated added in v1.22.0

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

Deprecated: 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 deprecated added in v1.22.0

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

Deprecated: 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 deprecated added in v1.22.0

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

Deprecated: 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 deprecated added in v1.22.0

func RegisterStruct(fqn FQN, strct reflect.Type)

Deprecated: 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 Set deprecated

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

Deprecated: 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 Sprintf added in v1.93.0

func Sprintf(format string, a ...interface{}) *string

Sprintf returns a pointer to a formatted string (semantics are the same as fmt.Sprintf).

func StaticGet deprecated

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

Deprecated: 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 deprecated added in v1.22.0

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

Deprecated: 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 deprecated added in v1.24.0

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

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

func StaticSet deprecated

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

Deprecated: 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 String added in v1.26.0

func String(v string) *string

String returns a pointer to the provided string.

func Strings added in v1.27.1

func Strings(v ...string) *[]*string

Strings returns a pointer to a slice of pointers to all of the provided strings.

func Time added in v1.27.1

func Time(v time.Time) *time.Time

Time returns a pointer to the provided time.Time.

func Times added in v1.27.1

func Times(v ...time.Time) *[]*time.Time

Times returns a pointer to a slice of pointers to all of the provided time.Time values.

func UnsafeCast added in v1.53.0

func UnsafeCast(from interface{}, into interface{})

UnsafeCast converts the given interface value to the desired target interface pointer. Panics if the from value is not a jsii proxy object, or if the to value is not a pointer to an interface type.

Types

type FQN deprecated

type FQN api.FQN

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

type Member deprecated added in v1.24.0

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

Deprecated: Member is a runtime descriptor for a class or interface member

type MemberMethod deprecated added in v1.24.0

type MemberMethod api.MethodOverride

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

type MemberProperty deprecated added in v1.24.0

type MemberProperty api.PropertyOverride

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

Directories

Path Synopsis
internal
api
Package api contains shared type definisions used by several modules part of the jsii runtime for go.
Package api contains shared type definisions used by several modules part of the jsii runtime for go.
embedded
Package embedded contains the embedded @jsii/kernel code, which is used unless the JSII_RUNTIME environment variable is set to a different program.
Package embedded contains the embedded @jsii/kernel code, which is used unless the JSII_RUNTIME environment variable is set to a different program.
kernel
Package kernel defines the interface for go programs to interact with the @jsii/kernel node process.
Package kernel defines the interface for go programs to interact with the @jsii/kernel node process.
objectstore
Package objectstore implements support for tracking a mapping of object references to and from their instance ID.
Package objectstore implements support for tracking a mapping of object references to and from their instance ID.
typeregistry
Package typeregistry offers features useful to manage the registration and operation of types in the context of the jsii runtime.
Package typeregistry offers features useful to manage the registration and operation of types in the context of the jsii runtime.
Package runtime provides the APIs used by code generated by the `jsii-pacmak` tool to interact with the `@jsii/kernel` process.
Package runtime provides the APIs used by code generated by the `jsii-pacmak` tool to interact with the `@jsii/kernel` process.

Jump to

Keyboard shortcuts

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