Documentation ¶
Index ¶
- Variables
- func RegisterDiscoveryServiceServer(s grpc.ServiceRegistrar, srv DiscoveryServiceServer)
- func RegisterHealthServiceServer(s grpc.ServiceRegistrar, srv HealthServiceServer)
- func RegisterOperationServiceServer(s grpc.ServiceRegistrar, srv OperationServiceServer)
- type DiscoveryServiceClient
- type DiscoveryServiceServer
- type DiscoveryService_WatchClient
- type DiscoveryService_WatchServer
- type HealthCheckRequest
- func (*HealthCheckRequest) Descriptor() ([]byte, []int)deprecated
- func (x *HealthCheckRequest) GetService() string
- func (*HealthCheckRequest) ProtoMessage()
- func (x *HealthCheckRequest) ProtoReflect() protoreflect.Message
- func (x *HealthCheckRequest) Reset()
- func (x *HealthCheckRequest) String() string
- type HealthCheckResponse
- func (*HealthCheckResponse) Descriptor() ([]byte, []int)deprecated
- func (x *HealthCheckResponse) GetStatus() HealthCheckResponse_ServingStatus
- func (*HealthCheckResponse) ProtoMessage()
- func (x *HealthCheckResponse) ProtoReflect() protoreflect.Message
- func (x *HealthCheckResponse) Reset()
- func (x *HealthCheckResponse) String() string
- type HealthCheckResponse_ServingStatus
- func (HealthCheckResponse_ServingStatus) Descriptor() protoreflect.EnumDescriptor
- func (x HealthCheckResponse_ServingStatus) Enum() *HealthCheckResponse_ServingStatus
- func (HealthCheckResponse_ServingStatus) EnumDescriptor() ([]byte, []int)deprecated
- func (x HealthCheckResponse_ServingStatus) Number() protoreflect.EnumNumber
- func (x HealthCheckResponse_ServingStatus) String() string
- func (HealthCheckResponse_ServingStatus) Type() protoreflect.EnumType
- type HealthServiceClient
- type HealthServiceServer
- type HealthService_WatchClient
- type HealthService_WatchServer
- type InitResponse
- type Mutation
- type Operation
- func (*Operation) Descriptor() ([]byte, []int)deprecated
- func (x *Operation) GetCursor() string
- func (x *Operation) GetDependencies() []*Operation_Id
- func (x *Operation) GetMutation() Mutation
- func (x *Operation) GetOperationId() *Operation_Id
- func (*Operation) ProtoMessage()
- func (x *Operation) ProtoReflect() protoreflect.Message
- func (x *Operation) Reset()
- func (x *Operation) String() string
- type OperationServiceClient
- type OperationServiceServer
- type OperationService_WatchClient
- type OperationService_WatchServer
- type Operation_Id
- func (*Operation_Id) Descriptor() ([]byte, []int)deprecated
- func (x *Operation_Id) GetCounterId() uint64
- func (x *Operation_Id) GetReplicaId() string
- func (*Operation_Id) ProtoMessage()
- func (x *Operation_Id) ProtoReflect() protoreflect.Message
- func (x *Operation_Id) Reset()
- func (x *Operation_Id) String() string
- type PeerInfo
- type ReceiveRequest
- type UnimplementedDiscoveryServiceServer
- type UnimplementedHealthServiceServer
- type UnimplementedOperationServiceServer
- type UnsafeDiscoveryServiceServer
- type UnsafeHealthServiceServer
- type UnsafeOperationServiceServer
Constants ¶
This section is empty.
Variables ¶
var ( HealthCheckResponse_ServingStatus_name = map[int32]string{ 0: "UNKNOWN", 1: "SERVING", 2: "NOT_SERVING", 3: "SERVICE_UNKNOWN", } HealthCheckResponse_ServingStatus_value = map[string]int32{ "UNKNOWN": 0, "SERVING": 1, "NOT_SERVING": 2, "SERVICE_UNKNOWN": 3, } )
Enum value maps for HealthCheckResponse_ServingStatus.
var ( Mutation_name = map[int32]string{ 0: "ASSIGN", 1: "INSERT", 2: "DELETE", } Mutation_value = map[string]int32{ "ASSIGN": 0, "INSERT": 1, "DELETE": 2, } )
Enum value maps for Mutation.
var DiscoveryService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "swarm.DiscoveryService", HandlerType: (*DiscoveryServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Init", Handler: _DiscoveryService_Init_Handler, }, }, Streams: []grpc.StreamDesc{ { StreamName: "Watch", Handler: _DiscoveryService_Watch_Handler, ServerStreams: true, }, }, Metadata: "proto/discoveryservice.proto", }
DiscoveryService_ServiceDesc is the grpc.ServiceDesc for DiscoveryService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_proto_discoveryservice_proto protoreflect.FileDescriptor
var File_proto_healthservice_proto protoreflect.FileDescriptor
var File_proto_operationservice_proto protoreflect.FileDescriptor
var HealthService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "health.HealthService", HandlerType: (*HealthServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Check", Handler: _HealthService_Check_Handler, }, }, Streams: []grpc.StreamDesc{ { StreamName: "Watch", Handler: _HealthService_Watch_Handler, ServerStreams: true, }, }, Metadata: "proto/healthservice.proto", }
HealthService_ServiceDesc is the grpc.ServiceDesc for HealthService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var OperationService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "operations.OperationService", HandlerType: (*OperationServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Receive", Handler: _OperationService_Receive_Handler, }, }, Streams: []grpc.StreamDesc{ { StreamName: "Watch", Handler: _OperationService_Watch_Handler, ServerStreams: true, }, }, Metadata: "proto/operationservice.proto", }
OperationService_ServiceDesc is the grpc.ServiceDesc for OperationService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterDiscoveryServiceServer ¶
func RegisterDiscoveryServiceServer(s grpc.ServiceRegistrar, srv DiscoveryServiceServer)
func RegisterHealthServiceServer ¶
func RegisterHealthServiceServer(s grpc.ServiceRegistrar, srv HealthServiceServer)
func RegisterOperationServiceServer ¶
func RegisterOperationServiceServer(s grpc.ServiceRegistrar, srv OperationServiceServer)
Types ¶
type DiscoveryServiceClient ¶
type DiscoveryServiceClient interface { // Receive all peers info Init(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*InitResponse, error) // Watch on latest peers! - Start with one node // --- eventually it will form a network. Watch(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (DiscoveryService_WatchClient, error) }
DiscoveryServiceClient is the client API for DiscoveryService service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
func NewDiscoveryServiceClient ¶
func NewDiscoveryServiceClient(cc grpc.ClientConnInterface) DiscoveryServiceClient
type DiscoveryServiceServer ¶
type DiscoveryServiceServer interface { // Receive all peers info Init(context.Context, *emptypb.Empty) (*InitResponse, error) // Watch on latest peers! - Start with one node // --- eventually it will form a network. Watch(*emptypb.Empty, DiscoveryService_WatchServer) error // contains filtered or unexported methods }
DiscoveryServiceServer is the server API for DiscoveryService service. All implementations must embed UnimplementedDiscoveryServiceServer for forward compatibility
type DiscoveryService_WatchClient ¶
type DiscoveryService_WatchClient interface { Recv() (*PeerInfo, error) grpc.ClientStream }
type DiscoveryService_WatchServer ¶
type DiscoveryService_WatchServer interface { Send(*PeerInfo) error grpc.ServerStream }
type HealthCheckRequest ¶
type HealthCheckRequest struct { Service string `protobuf:"bytes,1,opt,name=service,proto3" json:"service,omitempty"` // contains filtered or unexported fields }
func (*HealthCheckRequest) Descriptor
deprecated
func (*HealthCheckRequest) Descriptor() ([]byte, []int)
Deprecated: Use HealthCheckRequest.ProtoReflect.Descriptor instead.
func (*HealthCheckRequest) GetService ¶
func (x *HealthCheckRequest) GetService() string
func (*HealthCheckRequest) ProtoMessage ¶
func (*HealthCheckRequest) ProtoMessage()
func (*HealthCheckRequest) ProtoReflect ¶
func (x *HealthCheckRequest) ProtoReflect() protoreflect.Message
func (*HealthCheckRequest) Reset ¶
func (x *HealthCheckRequest) Reset()
func (*HealthCheckRequest) String ¶
func (x *HealthCheckRequest) String() string
type HealthCheckResponse ¶
type HealthCheckResponse struct { Status HealthCheckResponse_ServingStatus `protobuf:"varint,1,opt,name=status,proto3,enum=health.HealthCheckResponse_ServingStatus" json:"status,omitempty"` // contains filtered or unexported fields }
func (*HealthCheckResponse) Descriptor
deprecated
func (*HealthCheckResponse) Descriptor() ([]byte, []int)
Deprecated: Use HealthCheckResponse.ProtoReflect.Descriptor instead.
func (*HealthCheckResponse) GetStatus ¶
func (x *HealthCheckResponse) GetStatus() HealthCheckResponse_ServingStatus
func (*HealthCheckResponse) ProtoMessage ¶
func (*HealthCheckResponse) ProtoMessage()
func (*HealthCheckResponse) ProtoReflect ¶
func (x *HealthCheckResponse) ProtoReflect() protoreflect.Message
func (*HealthCheckResponse) Reset ¶
func (x *HealthCheckResponse) Reset()
func (*HealthCheckResponse) String ¶
func (x *HealthCheckResponse) String() string
type HealthCheckResponse_ServingStatus ¶
type HealthCheckResponse_ServingStatus int32
const ( HealthCheckResponse_UNKNOWN HealthCheckResponse_ServingStatus = 0 HealthCheckResponse_SERVING HealthCheckResponse_ServingStatus = 1 HealthCheckResponse_NOT_SERVING HealthCheckResponse_ServingStatus = 2 HealthCheckResponse_SERVICE_UNKNOWN HealthCheckResponse_ServingStatus = 3 // Used only by the Watch method. )
func (HealthCheckResponse_ServingStatus) Descriptor ¶
func (HealthCheckResponse_ServingStatus) Descriptor() protoreflect.EnumDescriptor
func (HealthCheckResponse_ServingStatus) Enum ¶
func (x HealthCheckResponse_ServingStatus) Enum() *HealthCheckResponse_ServingStatus
func (HealthCheckResponse_ServingStatus) EnumDescriptor
deprecated
func (HealthCheckResponse_ServingStatus) EnumDescriptor() ([]byte, []int)
Deprecated: Use HealthCheckResponse_ServingStatus.Descriptor instead.
func (HealthCheckResponse_ServingStatus) Number ¶
func (x HealthCheckResponse_ServingStatus) Number() protoreflect.EnumNumber
func (HealthCheckResponse_ServingStatus) String ¶
func (x HealthCheckResponse_ServingStatus) String() string
func (HealthCheckResponse_ServingStatus) Type ¶
func (HealthCheckResponse_ServingStatus) Type() protoreflect.EnumType
type HealthServiceClient ¶
type HealthServiceClient interface { Check(ctx context.Context, in *HealthCheckRequest, opts ...grpc.CallOption) (*HealthCheckResponse, error) Watch(ctx context.Context, in *HealthCheckRequest, opts ...grpc.CallOption) (HealthService_WatchClient, error) }
HealthServiceClient is the client API for HealthService service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
func NewHealthServiceClient ¶
func NewHealthServiceClient(cc grpc.ClientConnInterface) HealthServiceClient
type HealthServiceServer ¶
type HealthServiceServer interface { Check(context.Context, *HealthCheckRequest) (*HealthCheckResponse, error) Watch(*HealthCheckRequest, HealthService_WatchServer) error // contains filtered or unexported methods }
HealthServiceServer is the server API for HealthService service. All implementations must embed UnimplementedHealthServiceServer for forward compatibility
type HealthService_WatchClient ¶
type HealthService_WatchClient interface { Recv() (*HealthCheckResponse, error) grpc.ClientStream }
type HealthService_WatchServer ¶
type HealthService_WatchServer interface { Send(*HealthCheckResponse) error grpc.ServerStream }
type InitResponse ¶
type InitResponse struct { Peers []*PeerInfo `protobuf:"bytes,1,rep,name=peers,proto3" json:"peers,omitempty"` // contains filtered or unexported fields }
func (*InitResponse) Descriptor
deprecated
func (*InitResponse) Descriptor() ([]byte, []int)
Deprecated: Use InitResponse.ProtoReflect.Descriptor instead.
func (*InitResponse) GetPeers ¶
func (x *InitResponse) GetPeers() []*PeerInfo
func (*InitResponse) ProtoMessage ¶
func (*InitResponse) ProtoMessage()
func (*InitResponse) ProtoReflect ¶
func (x *InitResponse) ProtoReflect() protoreflect.Message
func (*InitResponse) Reset ¶
func (x *InitResponse) Reset()
func (*InitResponse) String ¶
func (x *InitResponse) String() string
type Mutation ¶
type Mutation int32
func (Mutation) Descriptor ¶
func (Mutation) Descriptor() protoreflect.EnumDescriptor
func (Mutation) EnumDescriptor
deprecated
func (Mutation) Number ¶
func (x Mutation) Number() protoreflect.EnumNumber
func (Mutation) Type ¶
func (Mutation) Type() protoreflect.EnumType
type Operation ¶
type Operation struct { // Node info OperationId *Operation_Id `protobuf:"bytes,1,opt,name=operation_id,json=operationId,proto3" json:"operation_id,omitempty"` // Dependency array Dependencies []*Operation_Id `protobuf:"bytes,2,rep,name=dependencies,proto3" json:"dependencies,omitempty"` // JsonPath cursor Cursor string `protobuf:"bytes,3,opt,name=cursor,proto3" json:"cursor,omitempty"` // Type of Operation Mutation Mutation `protobuf:"varint,4,opt,name=mutation,proto3,enum=operations.Mutation" json:"mutation,omitempty"` // contains filtered or unexported fields }
func (*Operation) Descriptor
deprecated
func (*Operation) GetDependencies ¶
func (x *Operation) GetDependencies() []*Operation_Id
func (*Operation) GetMutation ¶
func (*Operation) GetOperationId ¶
func (x *Operation) GetOperationId() *Operation_Id
func (*Operation) ProtoMessage ¶
func (*Operation) ProtoMessage()
func (*Operation) ProtoReflect ¶
func (x *Operation) ProtoReflect() protoreflect.Message
type OperationServiceClient ¶
type OperationServiceClient interface { // Unary RPC requesting committed operation of counter_id + 1 Receive(ctx context.Context, in *ReceiveRequest, opts ...grpc.CallOption) (*Operation, error) // Serverside streaming until both of their lamport counters matches. Watch(ctx context.Context, in *ReceiveRequest, opts ...grpc.CallOption) (OperationService_WatchClient, error) }
OperationServiceClient is the client API for OperationService service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
func NewOperationServiceClient ¶
func NewOperationServiceClient(cc grpc.ClientConnInterface) OperationServiceClient
type OperationServiceServer ¶
type OperationServiceServer interface { // Unary RPC requesting committed operation of counter_id + 1 Receive(context.Context, *ReceiveRequest) (*Operation, error) // Serverside streaming until both of their lamport counters matches. Watch(*ReceiveRequest, OperationService_WatchServer) error // contains filtered or unexported methods }
OperationServiceServer is the server API for OperationService service. All implementations must embed UnimplementedOperationServiceServer for forward compatibility
type OperationService_WatchClient ¶
type OperationService_WatchClient interface { Recv() (*Operation, error) grpc.ClientStream }
type OperationService_WatchServer ¶
type OperationService_WatchServer interface { Send(*Operation) error grpc.ServerStream }
type Operation_Id ¶
type Operation_Id struct { ReplicaId string `protobuf:"bytes,1,opt,name=replica_id,json=replicaId,proto3" json:"replica_id,omitempty"` CounterId uint64 `protobuf:"varint,2,opt,name=counter_id,json=counterId,proto3" json:"counter_id,omitempty"` // contains filtered or unexported fields }
func (*Operation_Id) Descriptor
deprecated
func (*Operation_Id) Descriptor() ([]byte, []int)
Deprecated: Use Operation_Id.ProtoReflect.Descriptor instead.
func (*Operation_Id) GetCounterId ¶
func (x *Operation_Id) GetCounterId() uint64
func (*Operation_Id) GetReplicaId ¶
func (x *Operation_Id) GetReplicaId() string
func (*Operation_Id) ProtoMessage ¶
func (*Operation_Id) ProtoMessage()
func (*Operation_Id) ProtoReflect ¶
func (x *Operation_Id) ProtoReflect() protoreflect.Message
func (*Operation_Id) Reset ¶
func (x *Operation_Id) Reset()
func (*Operation_Id) String ¶
func (x *Operation_Id) String() string
type PeerInfo ¶
type PeerInfo struct { Ip string `protobuf:"bytes,1,opt,name=ip,proto3" json:"ip,omitempty"` Port uint32 `protobuf:"varint,2,opt,name=port,proto3" json:"port,omitempty"` // contains filtered or unexported fields }
func (*PeerInfo) Descriptor
deprecated
func (*PeerInfo) ProtoMessage ¶
func (*PeerInfo) ProtoMessage()
func (*PeerInfo) ProtoReflect ¶
func (x *PeerInfo) ProtoReflect() protoreflect.Message
type ReceiveRequest ¶
type ReceiveRequest struct { // Node's latest lamport counter value. CounterId uint64 `protobuf:"varint,1,opt,name=counter_id,json=counterId,proto3" json:"counter_id,omitempty"` // contains filtered or unexported fields }
func (*ReceiveRequest) Descriptor
deprecated
func (*ReceiveRequest) Descriptor() ([]byte, []int)
Deprecated: Use ReceiveRequest.ProtoReflect.Descriptor instead.
func (*ReceiveRequest) GetCounterId ¶
func (x *ReceiveRequest) GetCounterId() uint64
func (*ReceiveRequest) ProtoMessage ¶
func (*ReceiveRequest) ProtoMessage()
func (*ReceiveRequest) ProtoReflect ¶
func (x *ReceiveRequest) ProtoReflect() protoreflect.Message
func (*ReceiveRequest) Reset ¶
func (x *ReceiveRequest) Reset()
func (*ReceiveRequest) String ¶
func (x *ReceiveRequest) String() string
type UnimplementedDiscoveryServiceServer ¶
type UnimplementedDiscoveryServiceServer struct { }
UnimplementedDiscoveryServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedDiscoveryServiceServer) Init ¶
func (UnimplementedDiscoveryServiceServer) Init(context.Context, *emptypb.Empty) (*InitResponse, error)
func (UnimplementedDiscoveryServiceServer) Watch ¶
func (UnimplementedDiscoveryServiceServer) Watch(*emptypb.Empty, DiscoveryService_WatchServer) error
type UnimplementedHealthServiceServer ¶
type UnimplementedHealthServiceServer struct { }
UnimplementedHealthServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedHealthServiceServer) Check ¶
func (UnimplementedHealthServiceServer) Check(context.Context, *HealthCheckRequest) (*HealthCheckResponse, error)
type UnimplementedOperationServiceServer ¶
type UnimplementedOperationServiceServer struct { }
UnimplementedOperationServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedOperationServiceServer) Receive ¶
func (UnimplementedOperationServiceServer) Receive(context.Context, *ReceiveRequest) (*Operation, error)
type UnsafeDiscoveryServiceServer ¶
type UnsafeDiscoveryServiceServer interface {
// contains filtered or unexported methods
}
UnsafeDiscoveryServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to DiscoveryServiceServer will result in compilation errors.
type UnsafeHealthServiceServer ¶
type UnsafeHealthServiceServer interface {
// contains filtered or unexported methods
}
UnsafeHealthServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to HealthServiceServer will result in compilation errors.
type UnsafeOperationServiceServer ¶
type UnsafeOperationServiceServer interface {
// contains filtered or unexported methods
}
UnsafeOperationServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to OperationServiceServer will result in compilation errors.