Documentation
¶
Index ¶
- Constants
- func DefaultCapabilities() shell.CapabilitySet
- type ClientMessage
- type Host
- type Options
- type ResumeEntry
- type Runtime
- func (r *Runtime) BaseURL() string
- func (r *Runtime) CloseWindow(windowID string) error
- func (r *Runtime) EmitShellEvent(windowID string, event shell.Event) error
- func (r *Runtime) HandleClientMessage(windowID string, raw []byte) error
- func (r *Runtime) PrepareWindow(windowID, path string) (WindowLaunch, error)
- func (r *Runtime) Shutdown(ctx context.Context) error
- func (r *Runtime) Start() error
- type StoragePaths
- type WindowLaunch
Constants ¶
const ( // HeaderLaunchToken authenticates top-level desktop-managed HTTP navigations. HeaderLaunchToken = "X-Vango-Desktop-Launch" // HeaderWindowID scopes desktop-managed HTTP navigations to a native window. HeaderWindowID = "X-Vango-Window-ID" // QueryWindowID scopes WebSocket upgrades to a native window. QueryWindowID = "vango_window" // QueryRuntimeToken authenticates WebSocket upgrades. QueryRuntimeToken = "vango_rt" )
Variables ¶
This section is empty.
Functions ¶
func DefaultCapabilities ¶
func DefaultCapabilities() shell.CapabilitySet
DefaultCapabilities returns the reference host's phase-1 capability surface.
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 desktop runtime.
type Host ¶
type Host interface {
Dispatch(windowID string, cmd shell.Command) error
Request(ctx context.Context, windowID 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 macOS desktop 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 window-scoped resumable session metadata.
type Runtime ¶
type Runtime struct {
// contains filtered or unexported fields
}
Runtime hosts a Vango app inside a native macOS shell.
func (*Runtime) CloseWindow ¶
CloseWindow removes the window registration and records its current route for restore/debugging.
func (*Runtime) EmitShellEvent ¶
EmitShellEvent publishes a host-originated shell event to the target window.
func (*Runtime) HandleClientMessage ¶
HandleClientMessage applies a client-originated host message, such as resume-store updates.
func (*Runtime) PrepareWindow ¶
func (r *Runtime) PrepareWindow(windowID, path string) (WindowLaunch, error)
PrepareWindow returns the loopback URL and headers required to load a window.