syncplanev1connect

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// AdminServiceRegisterProcedure is the fully-qualified name of the AdminService's Register RPC.
	AdminServiceRegisterProcedure = "/syncplane.v1.AdminService/Register"
	// AdminServiceGetSchemaProcedure is the fully-qualified name of the AdminService's GetSchema RPC.
	AdminServiceGetSchemaProcedure = "/syncplane.v1.AdminService/GetSchema"
)

These constants are the fully-qualified names of the RPCs defined in this package. They're exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route.

Note that these are different from the fully-qualified method names used by google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to reflection-formatted method names, remove the leading slash and convert the remaining slash to a period.

View Source
const (
	// PresenceServiceWatchProcedure is the fully-qualified name of the PresenceService's Watch RPC.
	PresenceServiceWatchProcedure = "/syncplane.v1.PresenceService/Watch"
	// PresenceServicePublishProcedure is the fully-qualified name of the PresenceService's Publish RPC.
	PresenceServicePublishProcedure = "/syncplane.v1.PresenceService/Publish"
)

These constants are the fully-qualified names of the RPCs defined in this package. They're exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route.

Note that these are different from the fully-qualified method names used by google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to reflection-formatted method names, remove the leading slash and convert the remaining slash to a period.

View Source
const (
	// SyncServicePushProcedure is the fully-qualified name of the SyncService's Push RPC.
	SyncServicePushProcedure = "/syncplane.v1.SyncService/Push"
	// SyncServicePullProcedure is the fully-qualified name of the SyncService's Pull RPC.
	SyncServicePullProcedure = "/syncplane.v1.SyncService/Pull"
	// SyncServiceBootstrapProcedure is the fully-qualified name of the SyncService's Bootstrap RPC.
	SyncServiceBootstrapProcedure = "/syncplane.v1.SyncService/Bootstrap"
	// SyncServiceSubscribeProcedure is the fully-qualified name of the SyncService's Subscribe RPC.
	SyncServiceSubscribeProcedure = "/syncplane.v1.SyncService/Subscribe"
	// SyncServiceQueryProcedure is the fully-qualified name of the SyncService's Query RPC.
	SyncServiceQueryProcedure = "/syncplane.v1.SyncService/Query"
)

These constants are the fully-qualified names of the RPCs defined in this package. They're exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route.

Note that these are different from the fully-qualified method names used by google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to reflection-formatted method names, remove the leading slash and convert the remaining slash to a period.

View Source
const (
	// AdminServiceName is the fully-qualified name of the AdminService service.
	AdminServiceName = "syncplane.v1.AdminService"
)
View Source
const (
	// PresenceServiceName is the fully-qualified name of the PresenceService service.
	PresenceServiceName = "syncplane.v1.PresenceService"
)
View Source
const (
	// SyncServiceName is the fully-qualified name of the SyncService service.
	SyncServiceName = "syncplane.v1.SyncService"
)

Variables

This section is empty.

Functions

func NewAdminServiceHandler

func NewAdminServiceHandler(svc AdminServiceHandler, opts ...connect.HandlerOption) (string, http.Handler)

NewAdminServiceHandler builds an HTTP handler from the service implementation. It returns the path on which to mount the handler and the handler itself.

By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf and JSON codecs. They also support gzip compression.

func NewPresenceServiceHandler

func NewPresenceServiceHandler(svc PresenceServiceHandler, opts ...connect.HandlerOption) (string, http.Handler)

NewPresenceServiceHandler builds an HTTP handler from the service implementation. It returns the path on which to mount the handler and the handler itself.

By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf and JSON codecs. They also support gzip compression.

func NewSyncServiceHandler

func NewSyncServiceHandler(svc SyncServiceHandler, opts ...connect.HandlerOption) (string, http.Handler)

NewSyncServiceHandler builds an HTTP handler from the service implementation. It returns the path on which to mount the handler and the handler itself.

By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf and JSON codecs. They also support gzip compression.

Types

type AdminServiceClient

type AdminServiceClient interface {
	// Registers or evolves an application's schema to serve full CRUD
	// synchronization.
	//
	// Takes a serialized `google.protobuf.FileDescriptorSet`, persists it,
	// and updates the application entities. This operation is idempotent:
	//   - Registering an app that was not registered before returns
	//     `REGISTER_STATUS_CREATED`.
	//   - Submitting an additive evolution returns `REGISTER_STATUS_UPDATED`.
	//   - Submitting an identical schema returns `REGISTER_STATUS_UNCHANGED`.
	//
	// The server rejects conflicting schema changes. If
	// `expected_revision` is set and does not match the application's
	// current revision, the server rejects the call with
	// `FAILED_PRECONDITION`.
	Register(context.Context, *connect.Request[v1.RegisterRequest]) (*connect.Response[v1.RegisterResponse], error)
	// Retrieves the persisted descriptor set for an application.
	//
	// Clients can use this descriptor set to rebuild descriptors directly from
	// the server instead of importing a schema bundle. If the application is
	// unknown, the server returns a response with `found` set to `false` and
	// an empty `descriptor_set`.
	GetSchema(context.Context, *connect.Request[v1.GetSchemaRequest]) (*connect.Response[v1.GetSchemaResponse], error)
}

AdminServiceClient is a client for the syncplane.v1.AdminService service.

func NewAdminServiceClient

func NewAdminServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) AdminServiceClient

NewAdminServiceClient constructs a client for the syncplane.v1.AdminService service. By default, it uses the Connect protocol with the binary Protobuf Codec, asks for gzipped responses, and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the connect.WithGRPC() or connect.WithGRPCWeb() options.

The URL supplied here should be the base URL for the Connect or gRPC server (for example, http://api.acme.com or https://acme.com/grpc).

type AdminServiceHandler

type AdminServiceHandler interface {
	// Registers or evolves an application's schema to serve full CRUD
	// synchronization.
	//
	// Takes a serialized `google.protobuf.FileDescriptorSet`, persists it,
	// and updates the application entities. This operation is idempotent:
	//   - Registering an app that was not registered before returns
	//     `REGISTER_STATUS_CREATED`.
	//   - Submitting an additive evolution returns `REGISTER_STATUS_UPDATED`.
	//   - Submitting an identical schema returns `REGISTER_STATUS_UNCHANGED`.
	//
	// The server rejects conflicting schema changes. If
	// `expected_revision` is set and does not match the application's
	// current revision, the server rejects the call with
	// `FAILED_PRECONDITION`.
	Register(context.Context, *connect.Request[v1.RegisterRequest]) (*connect.Response[v1.RegisterResponse], error)
	// Retrieves the persisted descriptor set for an application.
	//
	// Clients can use this descriptor set to rebuild descriptors directly from
	// the server instead of importing a schema bundle. If the application is
	// unknown, the server returns a response with `found` set to `false` and
	// an empty `descriptor_set`.
	GetSchema(context.Context, *connect.Request[v1.GetSchemaRequest]) (*connect.Response[v1.GetSchemaResponse], error)
}

AdminServiceHandler is an implementation of the syncplane.v1.AdminService service.

type PresenceServiceClient

type PresenceServiceClient interface {
	// Streams presence updates and broadcast messages for a fixed set of
	// topics.
	//
	// The stream first sends a `RoomSnapshot` for each watched topic, followed
	// by participant updates, departures, and broadcast messages as they
	// occur. The set of watched topics is fixed for the lifetime of the
	// stream. To change topics, close and reopen the stream.
	//
	// Delivery is at-most-once and unordered across topics. Dropped presence
	// updates are corrected by periodic re-announcements, but dropped
	// broadcast messages are not replayed.
	Watch(context.Context, *connect.Request[v1.WatchRequest]) (*connect.ServerStreamForClient[v1.WatchResponse], error)
	// Publishes presence state updates, broadcast messages, or departure
	// notices for a session.
	//
	// The server assigns the participant identity from the request principal.
	// The request payload cannot specify or override the sender identity.
	Publish(context.Context, *connect.Request[v1.PublishRequest]) (*connect.Response[v1.PublishResponse], error)
}

PresenceServiceClient is a client for the syncplane.v1.PresenceService service.

func NewPresenceServiceClient

func NewPresenceServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) PresenceServiceClient

NewPresenceServiceClient constructs a client for the syncplane.v1.PresenceService service. By default, it uses the Connect protocol with the binary Protobuf Codec, asks for gzipped responses, and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the connect.WithGRPC() or connect.WithGRPCWeb() options.

The URL supplied here should be the base URL for the Connect or gRPC server (for example, http://api.acme.com or https://acme.com/grpc).

type PresenceServiceHandler

type PresenceServiceHandler interface {
	// Streams presence updates and broadcast messages for a fixed set of
	// topics.
	//
	// The stream first sends a `RoomSnapshot` for each watched topic, followed
	// by participant updates, departures, and broadcast messages as they
	// occur. The set of watched topics is fixed for the lifetime of the
	// stream. To change topics, close and reopen the stream.
	//
	// Delivery is at-most-once and unordered across topics. Dropped presence
	// updates are corrected by periodic re-announcements, but dropped
	// broadcast messages are not replayed.
	Watch(context.Context, *connect.Request[v1.WatchRequest], *connect.ServerStream[v1.WatchResponse]) error
	// Publishes presence state updates, broadcast messages, or departure
	// notices for a session.
	//
	// The server assigns the participant identity from the request principal.
	// The request payload cannot specify or override the sender identity.
	Publish(context.Context, *connect.Request[v1.PublishRequest]) (*connect.Response[v1.PublishResponse], error)
}

PresenceServiceHandler is an implementation of the syncplane.v1.PresenceService service.

type SyncServiceClient

type SyncServiceClient interface {
	// Push applies batches of client mutations, one write transaction per
	// workspace. Business rejections are MutationResults, not RPC errors, and a
	// failure scoped to one workspace (a mutation-id gap, a revoked workspace)
	// is reported in that workspace's results rather than failing the request.
	Push(context.Context, *connect.Request[v1.PushRequest]) (*connect.Response[v1.PushResponse], error)
	// Pull returns row changes for one workspace since the given cursor.
	Pull(context.Context, *connect.Request[v1.PullRequest]) (*connect.Response[v1.PullResponse], error)
	// Bootstrap streams a full snapshot of one workspace: Begin, Chunk*, End.
	Bootstrap(context.Context, *connect.Request[v1.BootstrapRequest]) (*connect.ServerStreamForClient[v1.BootstrapResponse], error)
	// Subscribe is "a Pull that never closes", multiplexed over a set of
	// workspaces. It catches each scope up from its cursor, then pushes changed
	// rows down the stream as those workspaces change, so an already-subscribed
	// client applies them directly and skips the follow-up Pull RTT. Every
	// frame names the workspace it concerns. Subscribe carries payload and must
	// never silently drop a patch.
	//
	// The scope set is fixed for the life of the stream — adding a workspace,
	// removing one, or changing a subscription set is a close + reopen, since
	// the browser ConnectRPC subset has no bidi channel for an in-band control
	// message. Clients reconnect with backoff and fall back to Pull + polling.
	Subscribe(context.Context, *connect.Request[v1.SubscribeRequest]) (*connect.ServerStreamForClient[v1.SubscribeResponse], error)
	// Query runs a one-shot predicate query against current server state —
	// for data outside the synced subset. Results are snapshots: they are not
	// merged with local optimistic state and not stored. A declared secondary
	// index serves the query when one covers its predicate and ordering;
	// without one it scans and decodes every visible row of the entity per
	// request, O(entity) in time regardless of limit. Memory is bounded to the
	// page; prefer a selective predicate over deep pagination, and page with
	// after/before rather than offset.
	Query(context.Context, *connect.Request[v1.QueryRequest]) (*connect.Response[v1.QueryResponse], error)
}

SyncServiceClient is a client for the syncplane.v1.SyncService service.

func NewSyncServiceClient

func NewSyncServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) SyncServiceClient

NewSyncServiceClient constructs a client for the syncplane.v1.SyncService service. By default, it uses the Connect protocol with the binary Protobuf Codec, asks for gzipped responses, and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the connect.WithGRPC() or connect.WithGRPCWeb() options.

The URL supplied here should be the base URL for the Connect or gRPC server (for example, http://api.acme.com or https://acme.com/grpc).

type SyncServiceHandler

type SyncServiceHandler interface {
	// Push applies batches of client mutations, one write transaction per
	// workspace. Business rejections are MutationResults, not RPC errors, and a
	// failure scoped to one workspace (a mutation-id gap, a revoked workspace)
	// is reported in that workspace's results rather than failing the request.
	Push(context.Context, *connect.Request[v1.PushRequest]) (*connect.Response[v1.PushResponse], error)
	// Pull returns row changes for one workspace since the given cursor.
	Pull(context.Context, *connect.Request[v1.PullRequest]) (*connect.Response[v1.PullResponse], error)
	// Bootstrap streams a full snapshot of one workspace: Begin, Chunk*, End.
	Bootstrap(context.Context, *connect.Request[v1.BootstrapRequest], *connect.ServerStream[v1.BootstrapResponse]) error
	// Subscribe is "a Pull that never closes", multiplexed over a set of
	// workspaces. It catches each scope up from its cursor, then pushes changed
	// rows down the stream as those workspaces change, so an already-subscribed
	// client applies them directly and skips the follow-up Pull RTT. Every
	// frame names the workspace it concerns. Subscribe carries payload and must
	// never silently drop a patch.
	//
	// The scope set is fixed for the life of the stream — adding a workspace,
	// removing one, or changing a subscription set is a close + reopen, since
	// the browser ConnectRPC subset has no bidi channel for an in-band control
	// message. Clients reconnect with backoff and fall back to Pull + polling.
	Subscribe(context.Context, *connect.Request[v1.SubscribeRequest], *connect.ServerStream[v1.SubscribeResponse]) error
	// Query runs a one-shot predicate query against current server state —
	// for data outside the synced subset. Results are snapshots: they are not
	// merged with local optimistic state and not stored. A declared secondary
	// index serves the query when one covers its predicate and ordering;
	// without one it scans and decodes every visible row of the entity per
	// request, O(entity) in time regardless of limit. Memory is bounded to the
	// page; prefer a selective predicate over deep pagination, and page with
	// after/before rather than offset.
	Query(context.Context, *connect.Request[v1.QueryRequest]) (*connect.Response[v1.QueryResponse], error)
}

SyncServiceHandler is an implementation of the syncplane.v1.SyncService service.

type UnimplementedAdminServiceHandler

type UnimplementedAdminServiceHandler struct{}

UnimplementedAdminServiceHandler returns CodeUnimplemented from all methods.

type UnimplementedPresenceServiceHandler

type UnimplementedPresenceServiceHandler struct{}

UnimplementedPresenceServiceHandler returns CodeUnimplemented from all methods.

type UnimplementedSyncServiceHandler

type UnimplementedSyncServiceHandler struct{}

UnimplementedSyncServiceHandler returns CodeUnimplemented from all methods.

func (UnimplementedSyncServiceHandler) Pull

func (UnimplementedSyncServiceHandler) Push

Jump to

Keyboard shortcuts

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