nodebridge

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const MaxIPCFrameSize = 2 * 1024 * 1024

MaxIPCFrameSize limits IPC frames to 2 MiB. Line delimiters count toward the limit; the Unix length prefix is separate from its payload limit.

Variables

This section is empty.

Functions

func GenerateTypeScriptDeclarations

func GenerateTypeScriptDeclarations(functions map[string]*rpc.FunctionDefinition) string

GenerateTypeScriptDeclarations produces a strictly-typed TypeScript declaration file (.d.ts)

func ServeStdio

func ServeStdio(app *rpc.CoreRPC) error

ServeStdio starts a JSON-line stdio server for parent Node.js child processes

func ServeUnixSocket

func ServeUnixSocket(app *rpc.CoreRPC, socketPath string) error

ServeUnixSocket runs a Unix Domain Socket listener with explicit 0600 permissions

Types

type BridgeRequest

type BridgeRequest struct {
	ID       string            `json:"id"`
	Function string            `json:"function"`
	Data     any               `json:"data"`
	Headers  map[string]string `json:"headers,omitempty"`
}

BridgeRequest represents an IPC call from Node.js

type BridgeResponse

type BridgeResponse struct {
	ID      string `json:"id"`
	Status  string `json:"status"` // "ok" or "error"
	Data    any    `json:"data,omitempty"`
	Error   string `json:"error,omitempty"`
	Details any    `json:"details,omitempty"`
}

BridgeResponse represents the IPC response returned to Node.js

Jump to

Keyboard shortcuts

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