bootstrap

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: May 14, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultLivePath         = "/_vango/live"
	DefaultLegacyWSPath     = "/_vango/ws"
	DefaultClientScriptPath = "/_vango/client.js"
)
View Source
const (
	HeaderSurfaceKind           = "X-Vango-Surface-Kind"
	HeaderSurfacePlatform       = "X-Vango-Surface-Platform"
	HeaderSurfaceTopology       = "X-Vango-Surface-Topology"
	HeaderSurfaceWindowID       = "X-Vango-Surface-Window-ID"
	HeaderSurfaceAppVersion     = "X-Vango-Surface-App-Version"
	HeaderSurfaceBuildChannel   = "X-Vango-Surface-Build-Channel"
	HeaderSurfaceProofTimestamp = "X-Vango-Surface-Proof-Timestamp"
	HeaderSurfaceProofNonce     = "X-Vango-Surface-Proof-Nonce"
	HeaderSurfaceProofSignature = "X-Vango-Surface-Proof-Signature"
	// HeaderShellToken is adapter-private compatibility metadata.
	// Core server trust decisions must not rely on this value.
	HeaderShellToken        = "X-Vango-Shell-Token"
	HeaderShellCapabilities = "X-Vango-Shell-Capabilities"

	QuerySurfaceKind         = "vango_surface_kind"
	QuerySurfacePlatform     = "vango_surface_platform"
	QuerySurfaceTopology     = "vango_surface_topology"
	QuerySurfaceWindowID     = "vango_surface_window"
	QuerySurfaceAppVersion   = "vango_surface_app_version"
	QuerySurfaceBuildChannel = "vango_surface_build_channel"
	// QueryShellToken is adapter-private compatibility metadata.
	// Core server trust decisions must not rely on this value.
	QueryShellToken        = "vango_shell_token"
	QueryShellCapabilities = "vango_shell_capabilities"
	QueryHostedAuth        = "vango_hosted_auth"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Debug                      bool     `json:"debug,omitempty"`
	ModuleOrigins              []string `json:"moduleOrigins,omitempty"`
	AllowSrcdoc                bool     `json:"allowSrcdoc,omitempty"`
	AllowUnsafeRawHTML         bool     `json:"allowUnsafeRawHTML,omitempty"`
	AllowInsecureModuleOrigins bool     `json:"allowInsecureModuleOrigins,omitempty"`
}

Client configures thin-client startup behavior.

type Config

type Config struct {
	Surface   surface.Info `json:"surface,omitempty"`
	Transport Transport    `json:"transport,omitempty"`
	Runtime   Runtime      `json:"runtime,omitempty"`
	Resume    Resume       `json:"resume,omitempty"`
	Reconnect Reconnect    `json:"reconnect,omitempty"`
	Client    Client       `json:"client,omitempty"`
	Shell     Shell        `json:"shell,omitempty"`
}

Config is the canonical Vango thin-client bootstrap payload.

func Default

func Default() Config

Default returns the normalized browser/web bootstrap configuration.

func Merge

func Merge(base, override Config) Config

Merge overlays explicitly configured values from override onto base and returns a normalized result. Zero values in override do not replace base defaults unless they are represented explicitly (for example via pointer-backed reconnect fields).

func (Config) Clone

func (c Config) Clone() Config

Clone returns a deep copy of the bootstrap config.

func (Config) Normalize

func (c Config) Normalize() Config

Normalize applies default values without mutating the receiver.

type Reconnect

type Reconnect struct {
	Enabled          *bool  `json:"enabled,omitempty"`
	ToastOnReconnect *bool  `json:"toastOnReconnect,omitempty"`
	ToastMessage     string `json:"toastMessage,omitempty"`
	MaxRetries       *int   `json:"maxRetries,omitempty"`
	BaseDelay        *int   `json:"baseDelay,omitempty"`
	MaxDelay         *int   `json:"maxDelay,omitempty"`
}

Reconnect configures thin-client reconnect behavior.

Pointer-backed fields preserve explicit false/0 values in bootstrap JSON.

type Resume

type Resume struct {
	Store            ResumeStore `json:"store,omitempty"`
	Key              string      `json:"key,omitempty"`
	InitialSessionID string      `json:"initialSessionId,omitempty"`
	InitialLastSeq   uint64      `json:"initialLastSeq,omitempty"`
}

Resume configures resumable session persistence.

type ResumeStore

type ResumeStore string

ResumeStore identifies where the thin client should persist resumable session metadata.

const (
	ResumeStoreSessionStorage ResumeStore = "sessionStorage"
	ResumeStoreMemory         ResumeStore = "memory"
	ResumeStoreHost           ResumeStore = "host"
)

type Runtime

type Runtime struct {
	WebSocketURL    string            `json:"wsUrl,omitempty"`
	LivePath        string            `json:"livePath,omitempty"`
	WebSocketQuery  map[string]string `json:"wsQuery,omitempty"`
	ClientScriptURL string            `json:"clientScriptUrl,omitempty"`
	ClientHash      string            `json:"clientHash,omitempty"`
}

Runtime configures runtime endpoint discovery.

type Shell

type Shell struct {
	Capabilities map[string]bool `json:"capabilities,omitempty"`
	Mode         ShellMode       `json:"mode,omitempty"`
	Relay        ShellRelay      `json:"relay,omitempty"`
}

Shell exposes shell capability metadata to the client.

type ShellMode

type ShellMode string

ShellMode identifies how shell requests are delivered from the thin client.

const (
	ShellModeDirect ShellMode = "direct"
	ShellModeRelay  ShellMode = "relay"
)

type ShellRelay

type ShellRelay struct {
	Token     string `json:"token,omitempty"`
	TimeoutMS int    `json:"timeoutMs,omitempty"`
}

ShellRelay configures client-mediated shell relay behavior.

type Transport

type Transport struct {
	Kind TransportKind `json:"kind,omitempty"`
}

Transport configures the client transport.

type TransportKind

type TransportKind string

TransportKind identifies the client transport implementation.

const (
	TransportWebSocket  TransportKind = "websocket"
	TransportHostBridge TransportKind = "host_bridge"
)

Jump to

Keyboard shortcuts

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