Documentation ¶
Overview ¶
Package kernel defines the interface for go programs to interact with the @jsii/kernel node process. This module completely abstracts managament of the child process.
Index ¶
- func CloseClient()
- type BeginProps
- type BeginResponse
- type Client
- func (c *Client) Begin(props BeginProps) (response BeginResponse, err error)
- func (c *Client) CastAndSetToPtr(ptr interface{}, data interface{})
- func (c *Client) CastPtrToRef(dataVal reflect.Value) interface{}
- func (c *Client) Complete(props CompleteProps) (response CompleteResponse, err error)
- func (c *Client) Create(props CreateProps) (response CreateResponse, err error)
- func (c *Client) Del(props DelProps) (response DelResponse, err error)
- func (c *Client) End(props EndProps) (response EndResponse, err error)
- func (c *Client) FindObjectRef(obj reflect.Value) (ref api.ObjectRef, found bool)
- func (c *Client) Get(props GetProps) (response GetResponse, err error)
- func (c *Client) GetObject(objref api.ObjectRef) interface{}
- func (c *Client) Invoke(props InvokeProps) (response InvokeResponse, err error)
- func (c *Client) Load(props LoadProps, tarball []byte) (response LoadResponse, err error)
- func (c *Client) ManageObject(v reflect.Value) (ref api.ObjectRef, err error)
- func (c *Client) Naming(props NamingProps) (response NamingResponse, err error)
- func (c *Client) RegisterInstance(instance reflect.Value, objectRef api.ObjectRef) error
- func (c *Client) SGet(props StaticGetProps) (response GetResponse, err error)
- func (c *Client) SInvoke(props StaticInvokeProps) (response InvokeResponse, err error)
- func (c *Client) SSet(props StaticSetProps) (response SetResponse, err error)
- func (c *Client) Set(props SetProps) (response SetResponse, err error)
- func (c *Client) Stats() (response StatsResponse, err error)
- func (c *Client) Types() *typeregistry.TypeRegistry
- type CompleteProps
- type CompleteResponse
- type CreateProps
- type CreateResponse
- type DelProps
- type DelResponse
- type EndProps
- type EndResponse
- type GetProps
- type GetResponse
- type InvokeProps
- type InvokeResponse
- type LoadProps
- type LoadResponse
- type NamingProps
- type NamingResponse
- type SetProps
- type SetResponse
- type StaticGetProps
- type StaticInvokeProps
- type StaticSetProps
- type StatsResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CloseClient ¶
func CloseClient()
CloseClient finalizes the runtime process, signalling the end of the execution to the jsii kernel process, and waiting for graceful termination.
If a jsii Client is used *after* CloseClient was called, a new jsii kernel process will be initialized, and CloseClient should be called again to correctly finalize that, too.
Types ¶
type BeginProps ¶
type BeginResponse ¶
type BeginResponse struct { PromiseID *string `json:"promise_id"` // contains filtered or unexported fields }
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
The Client struct owns the jsii child process and its io interfaces. It also owns a map (objects) that tracks all object references by ID. This is used to call methods and access properties on objects passed by the runtime process by reference.
func GetClient ¶
func GetClient() *Client
GetClient returns a singleton Client instance, initializing one the first time it is called.
func (*Client) Begin ¶
func (c *Client) Begin(props BeginProps) (response BeginResponse, err error)
func (*Client) CastAndSetToPtr ¶
func (c *Client) CastAndSetToPtr(ptr interface{}, data interface{})
CastAndSetToPtr accepts a pointer to any type and attempts to cast the value argument to be the same type. Then it sets the value of the pointer element to be the newly cast data. This is used to cast payloads from JSII to expected return types for Get and Invoke functions.
func (*Client) CastPtrToRef ¶
Accepts pointers to structs that implement interfaces and searches for an existing object reference in the kernel. If it exists, it casts it to an objref for the runtime. Recursively casts types that may contain nested object references.
func (*Client) Complete ¶
func (c *Client) Complete(props CompleteProps) (response CompleteResponse, err error)
func (*Client) Create ¶
func (c *Client) Create(props CreateProps) (response CreateResponse, err error)
func (*Client) FindObjectRef ¶
func (*Client) Invoke ¶
func (c *Client) Invoke(props InvokeProps) (response InvokeResponse, err error)
func (*Client) Load ¶
func (c *Client) Load(props LoadProps, tarball []byte) (response LoadResponse, err error)
Load ensures the specified assembly has been loaded into the @jsii/kernel process. This call is idempotent (calling it several times with the same input results in the same output).
func (*Client) ManageObject ¶
func (*Client) Naming ¶
func (c *Client) Naming(props NamingProps) (response NamingResponse, err error)
func (*Client) RegisterInstance ¶
func (*Client) SGet ¶
func (c *Client) SGet(props StaticGetProps) (response GetResponse, err error)
func (*Client) SInvoke ¶
func (c *Client) SInvoke(props StaticInvokeProps) (response InvokeResponse, err error)
func (*Client) SSet ¶
func (c *Client) SSet(props StaticSetProps) (response SetResponse, err error)
func (*Client) Stats ¶
func (c *Client) Stats() (response StatsResponse, err error)
func (*Client) Types ¶
func (c *Client) Types() *typeregistry.TypeRegistry
type CompleteProps ¶
type CompleteResponse ¶
type CompleteResponse struct { CallbackID *string `json:"cbid"` // contains filtered or unexported fields }
type CreateProps ¶
type CreateResponse ¶
type CreateResponse struct { InstanceID string `json:"$jsii.byref"` // contains filtered or unexported fields }
TODO extends AnnotatedObjRef?
func (*CreateResponse) UnmarshalJSON ¶
func (r *CreateResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON provides custom unmarshalling implementation for response structs. Creating new types is required in order to avoid infinite recursion.
type DelResponse ¶
type DelResponse struct {
// contains filtered or unexported fields
}
type EndResponse ¶
type EndResponse struct { Result interface{} `json:"result"` // contains filtered or unexported fields }
type GetResponse ¶
type GetResponse struct { Value interface{} `json:"value"` // contains filtered or unexported fields }
func (*GetResponse) UnmarshalJSON ¶
func (r *GetResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON provides custom unmarshalling implementation for response structs. Creating new types is required in order to avoid infinite recursion.
type InvokeProps ¶
type InvokeResponse ¶
type InvokeResponse struct { Result interface{} `json:"result"` // contains filtered or unexported fields }
func (*InvokeResponse) UnmarshalJSON ¶
func (r *InvokeResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON provides custom unmarshalling implementation for response structs. Creating new types is required in order to avoid infinite recursion.
type LoadProps ¶
LoadProps holds the necessary information to load a library into the @jsii/kernel process through the Load method.
type LoadResponse ¶
type LoadResponse struct { Assembly string `json:"assembly"` Types float64 `json:"types"` // contains filtered or unexported fields }
LoadResponse contains the data returned by the @jsii/kernel process in response to a load request.
func (*LoadResponse) UnmarshalJSON ¶
func (r *LoadResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON provides custom unmarshalling implementation for response structs. Creating new types is required in order to avoid infinite recursion.
type NamingProps ¶
type NamingProps struct {
Assembly string `json:"assembly"`
}
type NamingResponse ¶
type NamingResponse struct {
// contains filtered or unexported fields
}
type SetResponse ¶
type SetResponse struct {
// contains filtered or unexported fields
}
func (*SetResponse) UnmarshalJSON ¶
func (r *SetResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON provides custom unmarshalling implementation for response structs. Creating new types is required in order to avoid infinite recursion.
type StaticGetProps ¶
type StaticInvokeProps ¶
type StaticSetProps ¶
type StatsResponse ¶
type StatsResponse struct { ObjectCount float64 `json:"object_count"` // contains filtered or unexported fields }