Documentation
¶
Index ¶
- Constants
- func DefaultCapabilities() shell.CapabilitySet
- type ClientMessage
- type HTTPResponse
- type Host
- type Options
- type ResumeEntry
- type Runtime
- func (r *Runtime) BaseURL() string
- func (r *Runtime) CloseScene(sceneID string) error
- func (r *Runtime) EmitShellEvent(sceneID string, event shell.Event) error
- func (r *Runtime) HandleClientMessage(sceneID string, raw []byte) error
- func (r *Runtime) HandleRequest(sceneID, method, path string, headers map[string]string, body []byte) (HTTPResponse, error)
- func (r *Runtime) PrepareScene(sceneID, path string) (SceneLaunch, error)
- func (r *Runtime) Shutdown(ctx context.Context) error
- func (r *Runtime) Start() error
- type SceneLaunch
- type StoragePaths
Constants ¶
const ( // DocumentScheme is the custom WKURLSchemeHandler scheme used by the iOS host. DocumentScheme = "vango" // QuerySceneID scopes WebSocket upgrades to a native iOS scene. QuerySceneID = "vango_scene" // QueryRuntimeToken authenticates embedded loopback WebSocket upgrades. QueryRuntimeToken = "vango_rt" )
Variables ¶
This section is empty.
Functions ¶
func DefaultCapabilities ¶
func DefaultCapabilities() shell.CapabilitySet
DefaultCapabilities returns the reference capability set for the iOS host.
Types ¶
type ClientMessage ¶
type ClientMessage struct {
Type string `json:"type"`
Payload json.RawMessage `json:"payload,omitempty"`
}
ClientMessage is sent from the embedded WebView back into the iOS runtime.
type HTTPResponse ¶
type HTTPResponse struct {
Status int `json:"status"`
Headers map[string]string `json:"headers,omitempty"`
Cookies []string `json:"cookies,omitempty"`
Body []byte `json:"body,omitempty"`
}
HTTPResponse is the in-memory response shape returned to the WKURLSchemeHandler.
type Host ¶
type Host interface {
Dispatch(sceneID string, cmd shell.Command) error
Request(ctx context.Context, sceneID string, req shell.Request) (shell.Response, error)
}
Host executes normalized shell commands and requests against the native host.
type Options ¶
type Options struct {
BundleID string
AppVersion string
BuildChannel string
ApplicationSupportDir string
CacheDir string
LogDir string
SessionStorePath string
RuntimeTokenTTL time.Duration
Capabilities shell.CapabilitySet
Logger *slog.Logger
}
Options configure the iOS mobile runtime.
type ResumeEntry ¶
type ResumeEntry struct {
Key string `json:"key,omitempty"`
SessionID string `json:"sessionID,omitempty"`
LastSeq uint64 `json:"lastSeq,omitempty"`
LastPath string `json:"lastPath,omitempty"`
UpdatedAt time.Time `json:"updatedAt,omitempty"`
}
ResumeEntry stores scene-scoped resumable session metadata.
type Runtime ¶
type Runtime struct {
// contains filtered or unexported fields
}
Runtime hosts a Vango app inside a native iOS shell.
func (*Runtime) BaseURL ¶
BaseURL returns the loopback server base URL used by the native host proxy.
func (*Runtime) CloseScene ¶
CloseScene removes the scene registration and preserves its current route.
func (*Runtime) EmitShellEvent ¶
EmitShellEvent publishes a host-originated shell event to the target scene.
func (*Runtime) HandleClientMessage ¶
HandleClientMessage applies a client-originated host bridge message.
func (*Runtime) HandleRequest ¶
func (r *Runtime) HandleRequest(sceneID, method, path string, headers map[string]string, body []byte) (HTTPResponse, error)
HandleRequest serves a scene-scoped in-memory HTTP request for the custom URL scheme handler.
func (*Runtime) PrepareScene ¶
func (r *Runtime) PrepareScene(sceneID, path string) (SceneLaunch, error)
PrepareScene registers a scene and returns the document URL plus native WebSocket URL.
type SceneLaunch ¶
type SceneLaunch struct {
SceneID string `json:"sceneID"`
URL string `json:"url"`
WebSocketURL string `json:"webSocketURL"`
}
SceneLaunch describes how the native host should bootstrap a scene.