jsii

package module
v1.49.0-go-generics.1 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2022 License: Apache-2.0 Imports: 4 Imported by: 1

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 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.

func UncheckedCast

func UncheckedCast[T any](from interface{}) (to T, err error)

UncheckedCast performs an un-checked cast from a value of type F to type T. It is the caller's responsibility to ensure the dynamic type of f is compatible with T. Incorrect use results in undefined behavior.

This function returns an error if the original object is not a jsii-managed object, or the target type is not a jsii-manageable interface.

func Unwrap

func Unwrap[T any](o Option[T]) T

Unwrap dereferences an Option[T] to its underlying value. Panics if the Option is nil. This is equivalent to calling `o.FromOption__()`.

Types

type Bool

type Bool bool

Bool is the jsii type system's bool type. It shares the underlying representation of bool and can be used as Option[Bool].

func (Bool) FromOption__

func (b Bool) FromOption__() Bool

type Json

type Json map[string]interface{}

Json is the jsii type system's JSON/object type. It shares the underlying representation of map[string]interface{} and can be used as Option[Json].

func (Json) FromOption__

func (j Json) FromOption__() Json

type Map

type Map[T any] map[string]T

Map is the jsii type system's map type. It shares the underlying representation of map[string]T and can be used as Option[Map[T]].

func (Map[T]) FromOption__

func (m Map[T]) FromOption__() Map[T]

type Number

type Number float64

Number is the jsii type system's number type. It shares the underlying representation of float64 and can be used as Option[Number].

func (Number) FromOption__

func (f Number) FromOption__() Number

type Option

type Option[T any] interface {
	// FromOption__ unwraps this Option[T] to the underlying T. Users should never
	// need to call this method directly, as it mostly serves as a marker
	// interface for optional-able values.
	FromOption__() T
}

Option is a marker interface for all types that can be used in an optional parameter position. Implementations of FromOption__ typically return their receiver. Most users will never need to implement this interface.

type Slice

type Slice[T any] []T

Slice is the jsii type system's Array/List type. It shares the underlying representation of []T and can be used as Option[Slice[T]].

func MakeSlice

func MakeSlice[T any](items ...T) Slice[T]

MakeSlice creates a SliceType[T] from a list of items.

func (Slice[T]) FromOption__

func (s Slice[T]) FromOption__() Slice[T]

type String

type String string

String is the jsii type system's string type. It shares the underlying representation of string and can be used as Option[String].

func (String) FromOption__

func (s String) FromOption__() String

type Time

type Time time.Time

Time is the jsii type system's date/time type. It shares the underlying representation of time.Time and can be used as Option[Time].

func (Time) FromOption__

func (t Time) FromOption__() Time

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