Documentation ¶
Index ¶
- Constants
- type BackupServer
- type ClusterServer
- type ClusterService
- type ConfigService
- type ForwardingKVServer
- func (r *ForwardingKVServer) DeleteRange(ctx context.Context, req *regattapb.DeleteRangeRequest) (*regattapb.DeleteRangeResponse, error)
- func (r *ForwardingKVServer) Put(ctx context.Context, req *regattapb.PutRequest) (*regattapb.PutResponse, error)
- func (r *ForwardingKVServer) Txn(ctx context.Context, req *regattapb.TxnRequest) (*regattapb.TxnResponse, error)
- type KVServer
- func (s *KVServer) DeleteRange(ctx context.Context, req *regattapb.DeleteRangeRequest) (*regattapb.DeleteRangeResponse, error)
- func (s *KVServer) IterateRange(req *regattapb.RangeRequest, srv regattapb.KV_IterateRangeServer) error
- func (s *KVServer) Put(ctx context.Context, req *regattapb.PutRequest) (*regattapb.PutResponse, error)
- func (s *KVServer) Range(ctx context.Context, req *regattapb.RangeRequest) (*regattapb.RangeResponse, error)
- func (s *KVServer) Txn(ctx context.Context, req *regattapb.TxnRequest) (*regattapb.TxnResponse, error)
- type KVService
- type LogReaderService
- type LogServer
- type MetadataServer
- type RESTServer
- type ReadonlyTablesServer
- type RegattaServer
- type ResetServer
- type SnapshotServer
- type SnapshotService
- type TableService
- type TablesServer
- func (t *TablesServer) AuthFuncOverride(ctx context.Context, _ string) (context.Context, error)
- func (t *TablesServer) Create(ctx context.Context, req *regattapb.CreateTableRequest) (*regattapb.CreateTableResponse, error)
- func (t *TablesServer) Delete(ctx context.Context, req *regattapb.DeleteTableRequest) (*regattapb.DeleteTableResponse, error)
- func (t *TablesServer) List(ctx context.Context, _ *regattapb.ListTablesRequest) (*regattapb.ListTablesResponse, error)
Constants ¶
const (
// DefaultMaxGRPCSize is the default maximum size of body of gRPC message to be loaded from dragonboat.
DefaultMaxGRPCSize = 4 * 1024 * 1024
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BackupServer ¶
type BackupServer struct { regattapb.UnimplementedMaintenanceServer Tables TableService AuthFunc func(ctx context.Context) (context.Context, error) }
BackupServer implements some Maintenance service methods from proto/regatta.proto.
func (*BackupServer) AuthFuncOverride ¶ added in v0.5.0
func (*BackupServer) Backup ¶
func (m *BackupServer) Backup(req *regattapb.BackupRequest, srv regattapb.Maintenance_BackupServer) error
func (*BackupServer) Restore ¶
func (m *BackupServer) Restore(srv regattapb.Maintenance_RestoreServer) error
type ClusterServer ¶ added in v0.3.0
type ClusterServer struct { regattapb.UnimplementedClusterServer Cluster ClusterService Config ConfigService }
func (*ClusterServer) MemberList ¶ added in v0.3.0
func (c *ClusterServer) MemberList(ctx context.Context, req *regattapb.MemberListRequest) (*regattapb.MemberListResponse, error)
func (*ClusterServer) Status ¶ added in v0.3.0
func (c *ClusterServer) Status(ctx context.Context, req *regattapb.StatusRequest) (*regattapb.StatusResponse, error)
type ClusterService ¶ added in v0.3.0
type ClusterService interface { MemberList(context.Context, *regattapb.MemberListRequest) (*regattapb.MemberListResponse, error) Status(context.Context, *regattapb.StatusRequest) (*regattapb.StatusResponse, error) }
type ConfigService ¶ added in v0.4.0
type ForwardingKVServer ¶ added in v0.5.0
type ForwardingKVServer struct { KVServer // contains filtered or unexported fields }
ForwardingKVServer forwards the write operations to the leader cluster.
func NewForwardingKVServer ¶ added in v0.5.0
func NewForwardingKVServer(storage KVService, client regattapb.KVClient, q *storage.IndexNotificationQueue) *ForwardingKVServer
func (*ForwardingKVServer) DeleteRange ¶ added in v0.5.0
func (r *ForwardingKVServer) DeleteRange(ctx context.Context, req *regattapb.DeleteRangeRequest) (*regattapb.DeleteRangeResponse, error)
DeleteRange implements proto/regatta.proto KV.DeleteRange method.
func (*ForwardingKVServer) Put ¶ added in v0.5.0
func (r *ForwardingKVServer) Put(ctx context.Context, req *regattapb.PutRequest) (*regattapb.PutResponse, error)
Put implements proto/regatta.proto KV.Put method.
func (*ForwardingKVServer) Txn ¶ added in v0.5.0
func (r *ForwardingKVServer) Txn(ctx context.Context, req *regattapb.TxnRequest) (*regattapb.TxnResponse, error)
Txn processes multiple requests in a single transaction. A txn request increments the revision of the key-value store and generates events with the same revision for every completed request. It is allowed to modify the same key several times within one txn (the result will be the last Op that modified the key). Readonly transactions allowed using follower API.
type KVServer ¶
type KVServer struct { regattapb.UnimplementedKVServer Storage KVService }
KVServer implements KV service from proto/regatta.proto.
func (*KVServer) DeleteRange ¶
func (s *KVServer) DeleteRange(ctx context.Context, req *regattapb.DeleteRangeRequest) (*regattapb.DeleteRangeResponse, error)
DeleteRange implements proto/regatta.proto KV.DeleteRange method.
func (*KVServer) IterateRange ¶ added in v0.4.0
func (s *KVServer) IterateRange(req *regattapb.RangeRequest, srv regattapb.KV_IterateRangeServer) error
IterateRange gets the keys in the range from the key-value store.
func (*KVServer) Put ¶
func (s *KVServer) Put(ctx context.Context, req *regattapb.PutRequest) (*regattapb.PutResponse, error)
Put implements proto/regatta.proto KV.Put method.
func (*KVServer) Range ¶
func (s *KVServer) Range(ctx context.Context, req *regattapb.RangeRequest) (*regattapb.RangeResponse, error)
Range implements proto/regatta.proto KV.Range method. Currently, only subset of functionality is implemented. The versioning functionality is not available.
func (*KVServer) Txn ¶
func (s *KVServer) Txn(ctx context.Context, req *regattapb.TxnRequest) (*regattapb.TxnResponse, error)
Txn processes multiple requests in a single transaction. A txn request increments the revision of the key-value store and generates events with the same revision for every completed request. It is allowed to modify the same key several times within one txn (the result will be the last Op that modified the key).
type KVService ¶
type KVService interface { Range(ctx context.Context, req *regattapb.RangeRequest) (*regattapb.RangeResponse, error) Put(ctx context.Context, req *regattapb.PutRequest) (*regattapb.PutResponse, error) Delete(ctx context.Context, req *regattapb.DeleteRangeRequest) (*regattapb.DeleteRangeResponse, error) Txn(ctx context.Context, req *regattapb.TxnRequest) (*regattapb.TxnResponse, error) IterateRange(ctx context.Context, req *regattapb.RangeRequest) (iter.Seq[*regattapb.RangeResponse], error) }
type LogReaderService ¶
type LogServer ¶
type LogServer struct { Tables TableService LogReader LogReaderService Log *zap.SugaredLogger regattapb.UnimplementedLogServer // contains filtered or unexported fields }
LogServer implements Log service from proto/replication.proto.
func NewLogServer ¶
func NewLogServer(ts TableService, lr LogReaderService, logger *zap.Logger, maxMessageSize uint64) *LogServer
func (*LogServer) Replicate ¶
func (l *LogServer) Replicate(req *regattapb.ReplicateRequest, server regattapb.Log_ReplicateServer) error
Replicate entries from the leader's log.
type MetadataServer ¶
type MetadataServer struct { regattapb.UnimplementedMetadataServer Tables TableService }
MetadataServer implements Metadata service from proto/replication.proto.
func (*MetadataServer) Get ¶
func (m *MetadataServer) Get(context.Context, *regattapb.MetadataRequest) (*regattapb.MetadataResponse, error)
type RESTServer ¶
type RESTServer struct {
// contains filtered or unexported fields
}
RESTServer is server exposing debug/healthcheck/metrics services of Regatta.
func NewRESTServer ¶
func NewRESTServer(addr string, readTimeout time.Duration) *RESTServer
NewRESTServer returns initialized REST server.
func (*RESTServer) ListenAndServe ¶
func (s *RESTServer) ListenAndServe() error
ListenAndServe starts underlying HTTP server.
func (*RESTServer) Shutdown ¶
func (s *RESTServer) Shutdown()
Shutdown stops underlying HTTP server.
type ReadonlyTablesServer ¶ added in v0.5.0
type ReadonlyTablesServer struct {
TablesServer
}
func (*ReadonlyTablesServer) Create ¶ added in v0.5.0
func (t *ReadonlyTablesServer) Create(context.Context, *regattapb.CreateTableRequest) (*regattapb.CreateTableResponse, error)
func (*ReadonlyTablesServer) Delete ¶ added in v0.5.0
func (t *ReadonlyTablesServer) Delete(context.Context, *regattapb.DeleteTableRequest) (*regattapb.DeleteTableResponse, error)
type RegattaServer ¶
type RegattaServer struct {
// contains filtered or unexported fields
}
RegattaServer is server where gRPC services can be registered in.
func NewServer ¶
func NewServer(addr, network string, opts ...grpc.ServerOption) *RegattaServer
NewServer returns initialized gRPC server.
func (*RegattaServer) Addr ¶
func (s *RegattaServer) Addr() string
func (*RegattaServer) ListenAndServe ¶
func (s *RegattaServer) ListenAndServe() error
ListenAndServe starts underlying gRPC server.
func (*RegattaServer) RegisterService ¶
func (s *RegattaServer) RegisterService(desc *grpc.ServiceDesc, impl interface{})
RegisterService implements grpc.ServiceRegistrar interface so internals of this type does not need to be exposed.
func (*RegattaServer) Shutdown ¶
func (s *RegattaServer) Shutdown()
Shutdown stops underlying gRPC server.
type ResetServer ¶
type ResetServer struct { regattapb.UnimplementedMaintenanceServer Tables TableService AuthFunc func(ctx context.Context) (context.Context, error) }
ResetServer implements some Maintenance service methods from proto/regatta.proto.
func (*ResetServer) AuthFuncOverride ¶ added in v0.5.0
func (*ResetServer) Reset ¶
func (m *ResetServer) Reset(ctx context.Context, req *regattapb.ResetRequest) (*regattapb.ResetResponse, error)
type SnapshotServer ¶
type SnapshotServer struct { regattapb.UnimplementedSnapshotServer Tables TableService }
SnapshotServer implements Snapshot service from proto/replication.proto.
func (*SnapshotServer) Stream ¶
func (s *SnapshotServer) Stream(req *regattapb.SnapshotRequest, srv regattapb.Snapshot_StreamServer) error
type SnapshotService ¶
type TableService ¶
type TablesServer ¶ added in v0.5.0
type TablesServer struct { regattapb.UnimplementedTablesServer Tables TableService AuthFunc func(ctx context.Context) (context.Context, error) }
func (*TablesServer) AuthFuncOverride ¶ added in v0.5.0
func (*TablesServer) Create ¶ added in v0.5.0
func (t *TablesServer) Create(ctx context.Context, req *regattapb.CreateTableRequest) (*regattapb.CreateTableResponse, error)
func (*TablesServer) Delete ¶ added in v0.5.0
func (t *TablesServer) Delete(ctx context.Context, req *regattapb.DeleteTableRequest) (*regattapb.DeleteTableResponse, error)
func (*TablesServer) List ¶ added in v0.5.0
func (t *TablesServer) List(ctx context.Context, _ *regattapb.ListTablesRequest) (*regattapb.ListTablesResponse, error)