Documentation
¶
Overview ¶
Package grpcproxy carries the data spine over gRPC: a Server that serves any data.Proxy, and a Client (itself a data.Proxy) that reaches it. The transport is grpc-transports/websocket, so the exact same query pipeline runs whether a Store talks to a MemoryProxy in-process or to this Client from a browser/wasm build — and the Views come back byte-identical.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterServer ¶
RegisterServer registers a DataService backed by proxy onto an existing grpc.Server — use it when mounting the service alongside others.
func Serve ¶
Serve starts a DataService for proxy over a WebSocket-carried gRPC listener bound to addr (use ":0" for an ephemeral port). It returns the ws:// URL a Client dials and a stop function that shuts the server down. The WebSocket carrier is what lets a browser/wasm Client speak this same gRPC service.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a data.Proxy backed by a remote DataService reached over a WebSocket-carried gRPC connection. It satisfies the same interface a MemoryProxy does, so a Store cannot tell whether its data is local or remote — and because the WebSocket transport compiles to js/wasm, this exact Client runs in a browser talking to the native Server.
func Dial ¶
Dial connects to a DataService at the given ws:// (or wss://) URL. Close the returned Client when done.
type Server ¶
type Server struct {
datapb.UnimplementedDataServiceServer
// contains filtered or unexported fields
}
Server adapts any data.Proxy to the DataService gRPC contract: each RPC simply delegates to the wrapped proxy (a MemoryProxy in practice), so the query pipeline that produces a View runs server-side and the client receives exactly that View. It is native-only — a browser is the client, never the server.
func (*Server) List ¶
func (s *Server) List(ctx context.Context, _ *datapb.ListRequest) (*datapb.ListResponse, error)
List returns every record.