Client islands runtime

Technical reference of Runtime de Client islands.

This API is used in Client components.


Symbols

SymbolClassDescription
ClientAssetTagtypeClientAssetTag defines a public type of API.
ClientIslandSnapshottypeClientIslandSnapshot defines a public type of API.
ClientIslandRuntimetypeClientIslandRuntime defines a public type of API.
BindClientIslandRuntimefuncInstall BindClientIslandRuntime.
WriteClientRuntimefuncWrite WriteClientRuntime.
WriteClientIslandfuncWrite WriteClientIsland.
WriteClientIslandDataAssetsfuncWrite WriteClientIslandDataAssets.
WriteClientPropsAttributefuncWrite WriteClientPropsAttribute.

ClientAssetTag

Declaration:

gox
type ClientAssetTag struct {
	ID   uint64
	HTML []byte
}

ClientAssetTag defines a public type of API.

Fields

FieldTypeDescription
IDuint64Unique identifier.
HTML[]bytePublic data associated with HTML.

ClientIslandSnapshot

Declaration:

gox
type ClientIslandSnapshot struct {
	ScriptURL  string
	StyleTags  []ClientAssetTag
	DataAssets []byte
}

ClientIslandSnapshot defines a public type of API.

Fields

FieldTypeDescription
ScriptURLstringRelated URL.
StyleTags[]ClientAssetTagPublic data associated with StyleTags.
DataAssets[]bytePublic data associated with DataAssets.

ClientIslandRuntime

Declaration:

gox
type ClientIslandRuntime interface {
	ResolveClientIsland(clientKey string) (ClientIslandSnapshot, bool)
	ClientRuntimeHTML() []byte
}

ClientIslandRuntime defines a public type of API.


BindClientIslandRuntime

Declaration:

gox
func BindClientIslandRuntime(ctx *Context, runtime ClientIslandRuntime)

Install BindClientIslandRuntime.

Parameters

ParameterTypeDescription
ctx*ContextContext of execution.
runtimeClientIslandRuntimeType value ClientIslandRuntime required by the operation.

WriteClientRuntime

Declaration:

gox
func WriteClientRuntime(ctx *Context)

Write WriteClientRuntime.

Parameters

ParameterTypeDescription
ctx*ContextContext of execution.

WriteClientIsland

Declaration:

gox
func WriteClientIsland(ctx *Context, clientKey string, writeOpen func(*Context), writeChildren func(*Context))

Write WriteClientIsland.

Parameters

ParameterTypeDescription
ctx*ContextContext of execution.
clientKeystringType value string required by the operation.
writeOpenfunc(*Context)Type value func(*Context) required by the operation.
writeChildrenfunc(*Context)Type value func(*Context) required by the operation.

WriteClientIslandDataAssets

Declaration:

gox
func WriteClientIslandDataAssets(ctx *Context)

Write WriteClientIslandDataAssets.

Parameters

ParameterTypeDescription
ctx*ContextContext of execution.

WriteClientPropsAttribute

Declaration:

gox
func WriteClientPropsAttribute(w Writer, props map[string]any, spreads ...any)

Write WriteClientPropsAttribute.

Parameters

ParameterTypeDescription
wWriterType value Writer required by the operation.
propsmap[string]anyType value map[string]any required by the operation.
spreads...anyType value ...any required by the operation.

See also

Next step

Continue with WebSocket bindings.

WebSocket runtime