Client islands runtime
Technical reference of Runtime de Client islands.
This API is used in Client components.
Symbols
| Symbol | Class | Description |
|---|---|---|
| ClientAssetTag | type | ClientAssetTag defines a public type of API. |
| ClientIslandSnapshot | type | ClientIslandSnapshot defines a public type of API. |
| ClientIslandRuntime | type | ClientIslandRuntime defines a public type of API. |
| BindClientIslandRuntime | func | Install BindClientIslandRuntime. |
| WriteClientRuntime | func | Write WriteClientRuntime. |
| WriteClientIsland | func | Write WriteClientIsland. |
| WriteClientIslandDataAssets | func | Write WriteClientIslandDataAssets. |
| WriteClientPropsAttribute | func | Write WriteClientPropsAttribute. |
ClientAssetTag
Declaration:
type ClientAssetTag struct {
ID uint64
HTML []byte
} ClientAssetTag defines a public type of API.
Fields
| Field | Type | Description |
|---|---|---|
ID | uint64 | Unique identifier. |
HTML | []byte | Public data associated with HTML. |
ClientIslandSnapshot
Declaration:
type ClientIslandSnapshot struct {
ScriptURL string
StyleTags []ClientAssetTag
DataAssets []byte
} ClientIslandSnapshot defines a public type of API.
Fields
| Field | Type | Description |
|---|---|---|
ScriptURL | string | Related URL. |
StyleTags | []ClientAssetTag | Public data associated with StyleTags. |
DataAssets | []byte | Public data associated with DataAssets. |
ClientIslandRuntime
Declaration:
type ClientIslandRuntime interface {
ResolveClientIsland(clientKey string) (ClientIslandSnapshot, bool)
ClientRuntimeHTML() []byte
} ClientIslandRuntime defines a public type of API.
BindClientIslandRuntime
Declaration:
func BindClientIslandRuntime(ctx *Context, runtime ClientIslandRuntime) Install BindClientIslandRuntime.
Parameters
| Parameter | Type | Description |
|---|---|---|
ctx | *Context | Context of execution. |
runtime | ClientIslandRuntime | Type value ClientIslandRuntime required by the operation. |
WriteClientRuntime
Declaration:
func WriteClientRuntime(ctx *Context) Write WriteClientRuntime.
Parameters
| Parameter | Type | Description |
|---|---|---|
ctx | *Context | Context of execution. |
WriteClientIsland
Declaration:
func WriteClientIsland(ctx *Context, clientKey string, writeOpen func(*Context), writeChildren func(*Context)) Write WriteClientIsland.
Parameters
| Parameter | Type | Description |
|---|---|---|
ctx | *Context | Context of execution. |
clientKey | string | Type value string required by the operation. |
writeOpen | func(*Context) | Type value func(*Context) required by the operation. |
writeChildren | func(*Context) | Type value func(*Context) required by the operation. |
WriteClientIslandDataAssets
Declaration:
func WriteClientIslandDataAssets(ctx *Context) Write WriteClientIslandDataAssets.
Parameters
| Parameter | Type | Description |
|---|---|---|
ctx | *Context | Context of execution. |
WriteClientPropsAttribute
Declaration:
func WriteClientPropsAttribute(w Writer, props map[string]any, spreads ...any) Write WriteClientPropsAttribute.
Parameters
| Parameter | Type | Description |
|---|---|---|
w | Writer | Type value Writer required by the operation. |
props | map[string]any | Type value map[string]any required by the operation. |
spreads | ...any | Type value ...any required by the operation. |