Documentation
¶
Index ¶
- Constants
- func NewAdminServiceHandler(svc AdminServiceHandler, opts ...connect.HandlerOption) (string, http.Handler)
- func NewPresenceServiceHandler(svc PresenceServiceHandler, opts ...connect.HandlerOption) (string, http.Handler)
- func NewSyncServiceHandler(svc SyncServiceHandler, opts ...connect.HandlerOption) (string, http.Handler)
- type AdminServiceClient
- type AdminServiceHandler
- type PresenceServiceClient
- type PresenceServiceHandler
- type SyncServiceClient
- type SyncServiceHandler
- type UnimplementedAdminServiceHandler
- func (UnimplementedAdminServiceHandler) GetSchema(context.Context, *connect.Request[v1.GetSchemaRequest]) (*connect.Response[v1.GetSchemaResponse], error)
- func (UnimplementedAdminServiceHandler) Register(context.Context, *connect.Request[v1.RegisterRequest]) (*connect.Response[v1.RegisterResponse], error)
- type UnimplementedPresenceServiceHandler
- type UnimplementedSyncServiceHandler
- func (UnimplementedSyncServiceHandler) Bootstrap(context.Context, *connect.Request[v1.BootstrapRequest], ...) error
- func (UnimplementedSyncServiceHandler) Pull(context.Context, *connect.Request[v1.PullRequest]) (*connect.Response[v1.PullResponse], error)
- func (UnimplementedSyncServiceHandler) Push(context.Context, *connect.Request[v1.PushRequest]) (*connect.Response[v1.PushResponse], error)
- func (UnimplementedSyncServiceHandler) Query(context.Context, *connect.Request[v1.QueryRequest]) (*connect.Response[v1.QueryResponse], error)
- func (UnimplementedSyncServiceHandler) Subscribe(context.Context, *connect.Request[v1.SubscribeRequest], ...) error
Constants ¶
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.
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.
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.
const (
// AdminServiceName is the fully-qualified name of the AdminService service.
AdminServiceName = "syncplane.v1.AdminService"
)
const (
// PresenceServiceName is the fully-qualified name of the PresenceService service.
PresenceServiceName = "syncplane.v1.PresenceService"
)
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 schema for CRUD synchronization.
//
// This operation is idempotent:
// - Registering an application 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 current application 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.
//
// 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 schema for CRUD synchronization.
//
// This operation is idempotent:
// - Registering an application 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 current application 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.
//
// 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 {
// Applies batches of client mutations, using one write transaction per
// workspace.
//
// Business rejections return as `MutationResult` messages, not RPC errors.
// The server reports a failure scoped to one workspace (such as a mutation
// ID gap or a revoked workspace) in that workspace's results without
// failing the request.
Push(context.Context, *connect.Request[v1.PushRequest]) (*connect.Response[v1.PushResponse], error)
// Returns row changes for one workspace since the specified cursor.
Pull(context.Context, *connect.Request[v1.PullRequest]) (*connect.Response[v1.PullResponse], error)
// Streams a full snapshot of one workspace in sequence: `Begin`, zero or
// more `Chunk` messages, and `End`.
Bootstrap(context.Context, *connect.Request[v1.BootstrapRequest]) (*connect.ServerStreamForClient[v1.BootstrapResponse], error)
// Streams row changes across a set of workspaces.
//
// Catches up each workspace scope from its cursor, then sends row changes
// as those workspaces update. Every frame identifies the workspace that it
// concerns. The stream carries change payloads and must never silently
// drop a patch.
//
// The set of workspace scopes is fixed for the life of the stream. To add
// or remove a workspace, or to change a subscription set, close and reopen
// the stream. Clients reconnect with backoff and fall back to `Pull`
// polling.
Subscribe(context.Context, *connect.Request[v1.SubscribeRequest]) (*connect.ServerStreamForClient[v1.SubscribeResponse], error)
// 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 are not stored.
//
// A declared secondary index serves the query when one covers the query
// predicate and ordering. Without a covering index, the query scans and
// decodes every visible row of the entity per request, running in
// O(entity) time regardless of limit.
//
// Memory is bounded to the page. Prefer selective predicates over deep
// pagination, and paginate with `after` or `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 {
// Applies batches of client mutations, using one write transaction per
// workspace.
//
// Business rejections return as `MutationResult` messages, not RPC errors.
// The server reports a failure scoped to one workspace (such as a mutation
// ID gap or a revoked workspace) in that workspace's results without
// failing the request.
Push(context.Context, *connect.Request[v1.PushRequest]) (*connect.Response[v1.PushResponse], error)
// Returns row changes for one workspace since the specified cursor.
Pull(context.Context, *connect.Request[v1.PullRequest]) (*connect.Response[v1.PullResponse], error)
// Streams a full snapshot of one workspace in sequence: `Begin`, zero or
// more `Chunk` messages, and `End`.
Bootstrap(context.Context, *connect.Request[v1.BootstrapRequest], *connect.ServerStream[v1.BootstrapResponse]) error
// Streams row changes across a set of workspaces.
//
// Catches up each workspace scope from its cursor, then sends row changes
// as those workspaces update. Every frame identifies the workspace that it
// concerns. The stream carries change payloads and must never silently
// drop a patch.
//
// The set of workspace scopes is fixed for the life of the stream. To add
// or remove a workspace, or to change a subscription set, close and reopen
// the stream. Clients reconnect with backoff and fall back to `Pull`
// polling.
Subscribe(context.Context, *connect.Request[v1.SubscribeRequest], *connect.ServerStream[v1.SubscribeResponse]) error
// 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 are not stored.
//
// A declared secondary index serves the query when one covers the query
// predicate and ordering. Without a covering index, the query scans and
// decodes every visible row of the entity per request, running in
// O(entity) time regardless of limit.
//
// Memory is bounded to the page. Prefer selective predicates over deep
// pagination, and paginate with `after` or `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.
func (UnimplementedAdminServiceHandler) GetSchema ¶
func (UnimplementedAdminServiceHandler) GetSchema(context.Context, *connect.Request[v1.GetSchemaRequest]) (*connect.Response[v1.GetSchemaResponse], error)
func (UnimplementedAdminServiceHandler) Register ¶
func (UnimplementedAdminServiceHandler) Register(context.Context, *connect.Request[v1.RegisterRequest]) (*connect.Response[v1.RegisterResponse], error)
type UnimplementedPresenceServiceHandler ¶
type UnimplementedPresenceServiceHandler struct{}
UnimplementedPresenceServiceHandler returns CodeUnimplemented from all methods.
func (UnimplementedPresenceServiceHandler) Publish ¶
func (UnimplementedPresenceServiceHandler) Publish(context.Context, *connect.Request[v1.PublishRequest]) (*connect.Response[v1.PublishResponse], error)
func (UnimplementedPresenceServiceHandler) Watch ¶
func (UnimplementedPresenceServiceHandler) Watch(context.Context, *connect.Request[v1.WatchRequest], *connect.ServerStream[v1.WatchResponse]) error
type UnimplementedSyncServiceHandler ¶
type UnimplementedSyncServiceHandler struct{}
UnimplementedSyncServiceHandler returns CodeUnimplemented from all methods.
func (UnimplementedSyncServiceHandler) Bootstrap ¶
func (UnimplementedSyncServiceHandler) Bootstrap(context.Context, *connect.Request[v1.BootstrapRequest], *connect.ServerStream[v1.BootstrapResponse]) error
func (UnimplementedSyncServiceHandler) Pull ¶
func (UnimplementedSyncServiceHandler) Pull(context.Context, *connect.Request[v1.PullRequest]) (*connect.Response[v1.PullResponse], error)
func (UnimplementedSyncServiceHandler) Push ¶
func (UnimplementedSyncServiceHandler) Push(context.Context, *connect.Request[v1.PushRequest]) (*connect.Response[v1.PushResponse], error)
func (UnimplementedSyncServiceHandler) Query ¶
func (UnimplementedSyncServiceHandler) Query(context.Context, *connect.Request[v1.QueryRequest]) (*connect.Response[v1.QueryResponse], error)
func (UnimplementedSyncServiceHandler) Subscribe ¶
func (UnimplementedSyncServiceHandler) Subscribe(context.Context, *connect.Request[v1.SubscribeRequest], *connect.ServerStream[v1.SubscribeResponse]) error