Documentation
¶
Index ¶
- Variables
- func RegisterCommandApiServer(s grpc.ServiceRegistrar, srv CommandApiServer)
- func RegisterCoordinatorApiServer(s grpc.ServiceRegistrar, srv CoordinatorApiServer)
- type Cmd
- type Command
- type CommandApiClient
- type CommandApiServer
- type CommandResponse
- func (*CommandResponse) Descriptor() ([]byte, []int)deprecated
- func (x *CommandResponse) GetData() string
- func (x *CommandResponse) GetSuccess() bool
- func (*CommandResponse) ProtoMessage()
- func (x *CommandResponse) ProtoReflect() protoreflect.Message
- func (x *CommandResponse) Reset()
- func (x *CommandResponse) String() string
- type CoordinatorApiClient
- type CoordinatorApiServer
- type CoordinatorResponse
- func (*CoordinatorResponse) Descriptor() ([]byte, []int)deprecated
- func (x *CoordinatorResponse) GetData() string
- func (x *CoordinatorResponse) GetSuccess() bool
- func (*CoordinatorResponse) ProtoMessage()
- func (x *CoordinatorResponse) ProtoReflect() protoreflect.Message
- func (x *CoordinatorResponse) Reset()
- func (x *CoordinatorResponse) String() string
- type Event
- func (*Event) Descriptor() ([]byte, []int)deprecated
- func (x *Event) GetFrom() string
- func (x *Event) GetId() uint64
- func (x *Event) GetLClock() uint64
- func (x *Event) GetNoop() *Noop
- func (x *Event) GetOrigin() string
- func (m *Event) GetPayload() isEvent_Payload
- func (x *Event) GetRingState() *RingState
- func (*Event) ProtoMessage()
- func (x *Event) ProtoReflect() protoreflect.Message
- func (x *Event) Reset()
- func (x *Event) String() string
- type Event_Noop
- type Event_RingState
- type NodeState
- func (*NodeState) Descriptor() ([]byte, []int)deprecated
- func (x *NodeState) GetHost() string
- func (x *NodeState) GetName() string
- func (x *NodeState) GetPort() uint32
- func (x *NodeState) GetRamSize() uint32
- func (x *NodeState) GetVNumbers() []uint32
- func (*NodeState) ProtoMessage()
- func (x *NodeState) ProtoReflect() protoreflect.Message
- func (x *NodeState) Reset()
- func (x *NodeState) String() string
- type Noop
- type RingState
- type UnimplementedCommandApiServer
- type UnimplementedCoordinatorApiServer
- func (UnimplementedCoordinatorApiServer) Del(context.Context, *Command) (*CoordinatorResponse, error)
- func (UnimplementedCoordinatorApiServer) Get(context.Context, *Command) (*CoordinatorResponse, error)
- func (UnimplementedCoordinatorApiServer) Set(context.Context, *Command) (*CoordinatorResponse, error)
- type UnsafeCommandApiServer
- type UnsafeCoordinatorApiServer
Constants ¶
This section is empty.
Variables ¶
var ( Cmd_name = map[int32]string{ 0: "GET", 1: "SET", 2: "DEL", } Cmd_value = map[string]int32{ "GET": 0, "SET": 1, "DEL": 2, } )
Enum value maps for Cmd.
var CommandApi_ServiceDesc = grpc.ServiceDesc{ ServiceName: "commandApi", HandlerType: (*CommandApiServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Get", Handler: _CommandApi_Get_Handler, }, { MethodName: "Set", Handler: _CommandApi_Set_Handler, }, { MethodName: "Del", Handler: _CommandApi_Del_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "node.proto", }
CommandApi_ServiceDesc is the grpc.ServiceDesc for CommandApi service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var CoordinatorApi_ServiceDesc = grpc.ServiceDesc{ ServiceName: "CoordinatorApi", HandlerType: (*CoordinatorApiServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Get", Handler: _CoordinatorApi_Get_Handler, }, { MethodName: "Set", Handler: _CoordinatorApi_Set_Handler, }, { MethodName: "Del", Handler: _CoordinatorApi_Del_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "node.proto", }
CoordinatorApi_ServiceDesc is the grpc.ServiceDesc for CoordinatorApi service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_node_proto protoreflect.FileDescriptor
Functions ¶
func RegisterCommandApiServer ¶
func RegisterCommandApiServer(s grpc.ServiceRegistrar, srv CommandApiServer)
func RegisterCoordinatorApiServer ¶
func RegisterCoordinatorApiServer(s grpc.ServiceRegistrar, srv CoordinatorApiServer)
Types ¶
type Cmd ¶
type Cmd int32
func (Cmd) Descriptor ¶
func (Cmd) Descriptor() protoreflect.EnumDescriptor
func (Cmd) EnumDescriptor
deprecated
func (Cmd) Number ¶
func (x Cmd) Number() protoreflect.EnumNumber
func (Cmd) Type ¶
func (Cmd) Type() protoreflect.EnumType
type Command ¶
type Command struct { Cmd Cmd `protobuf:"varint,1,opt,name=cmd,proto3,enum=Cmd" json:"cmd,omitempty"` Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` Data string `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` // contains filtered or unexported fields }
func (*Command) Descriptor
deprecated
func (*Command) ProtoMessage ¶
func (*Command) ProtoMessage()
func (*Command) ProtoReflect ¶
func (x *Command) ProtoReflect() protoreflect.Message
type CommandApiClient ¶
type CommandApiClient interface { Get(ctx context.Context, in *Command, opts ...grpc.CallOption) (*CommandResponse, error) Set(ctx context.Context, in *Command, opts ...grpc.CallOption) (*CommandResponse, error) Del(ctx context.Context, in *Command, opts ...grpc.CallOption) (*CommandResponse, error) }
CommandApiClient is the client API for CommandApi 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 NewCommandApiClient ¶
func NewCommandApiClient(cc grpc.ClientConnInterface) CommandApiClient
type CommandApiServer ¶
type CommandApiServer interface { Get(context.Context, *Command) (*CommandResponse, error) Set(context.Context, *Command) (*CommandResponse, error) Del(context.Context, *Command) (*CommandResponse, error) // contains filtered or unexported methods }
CommandApiServer is the server API for CommandApi service. All implementations must embed UnimplementedCommandApiServer for forward compatibility
type CommandResponse ¶
type CommandResponse struct { Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` Data string `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` // contains filtered or unexported fields }
func (*CommandResponse) Descriptor
deprecated
func (*CommandResponse) Descriptor() ([]byte, []int)
Deprecated: Use CommandResponse.ProtoReflect.Descriptor instead.
func (*CommandResponse) GetData ¶
func (x *CommandResponse) GetData() string
func (*CommandResponse) GetSuccess ¶
func (x *CommandResponse) GetSuccess() bool
func (*CommandResponse) ProtoMessage ¶
func (*CommandResponse) ProtoMessage()
func (*CommandResponse) ProtoReflect ¶
func (x *CommandResponse) ProtoReflect() protoreflect.Message
func (*CommandResponse) Reset ¶
func (x *CommandResponse) Reset()
func (*CommandResponse) String ¶
func (x *CommandResponse) String() string
type CoordinatorApiClient ¶
type CoordinatorApiClient interface { Get(ctx context.Context, in *Command, opts ...grpc.CallOption) (*CoordinatorResponse, error) Set(ctx context.Context, in *Command, opts ...grpc.CallOption) (*CoordinatorResponse, error) Del(ctx context.Context, in *Command, opts ...grpc.CallOption) (*CoordinatorResponse, error) }
CoordinatorApiClient is the client API for CoordinatorApi 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 NewCoordinatorApiClient ¶
func NewCoordinatorApiClient(cc grpc.ClientConnInterface) CoordinatorApiClient
type CoordinatorApiServer ¶
type CoordinatorApiServer interface { Get(context.Context, *Command) (*CoordinatorResponse, error) Set(context.Context, *Command) (*CoordinatorResponse, error) Del(context.Context, *Command) (*CoordinatorResponse, error) // contains filtered or unexported methods }
CoordinatorApiServer is the server API for CoordinatorApi service. All implementations must embed UnimplementedCoordinatorApiServer for forward compatibility
type CoordinatorResponse ¶
type CoordinatorResponse struct { Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` Data string `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` // contains filtered or unexported fields }
func (*CoordinatorResponse) Descriptor
deprecated
func (*CoordinatorResponse) Descriptor() ([]byte, []int)
Deprecated: Use CoordinatorResponse.ProtoReflect.Descriptor instead.
func (*CoordinatorResponse) GetData ¶
func (x *CoordinatorResponse) GetData() string
func (*CoordinatorResponse) GetSuccess ¶
func (x *CoordinatorResponse) GetSuccess() bool
func (*CoordinatorResponse) ProtoMessage ¶
func (*CoordinatorResponse) ProtoMessage()
func (*CoordinatorResponse) ProtoReflect ¶
func (x *CoordinatorResponse) ProtoReflect() protoreflect.Message
func (*CoordinatorResponse) Reset ¶
func (x *CoordinatorResponse) Reset()
func (*CoordinatorResponse) String ¶
func (x *CoordinatorResponse) String() string
type Event ¶
type Event struct { Id uint64 `protobuf:"varint,1,opt,name=Id,proto3" json:"Id,omitempty"` LClock uint64 `protobuf:"varint,2,opt,name=LClock,proto3" json:"LClock,omitempty"` Origin string `protobuf:"bytes,3,opt,name=Origin,proto3" json:"Origin,omitempty"` From string `protobuf:"bytes,4,opt,name=From,proto3" json:"From,omitempty"` // Types that are assignable to Payload: // // *Event_Noop // *Event_RingState Payload isEvent_Payload `protobuf_oneof:"Payload"` // contains filtered or unexported fields }
func (*Event) Descriptor
deprecated
func (*Event) GetPayload ¶
func (m *Event) GetPayload() isEvent_Payload
func (*Event) GetRingState ¶
func (*Event) ProtoMessage ¶
func (*Event) ProtoMessage()
func (*Event) ProtoReflect ¶
func (x *Event) ProtoReflect() protoreflect.Message
type Event_Noop ¶
type Event_Noop struct {
Noop *Noop `protobuf:"bytes,101,opt,name=noop,proto3,oneof"`
}
type Event_RingState ¶
type Event_RingState struct {
RingState *RingState `protobuf:"bytes,102,opt,name=ringState,proto3,oneof"`
}
type NodeState ¶
type NodeState struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Host string `protobuf:"bytes,2,opt,name=host,proto3" json:"host,omitempty"` Port uint32 `protobuf:"varint,3,opt,name=port,proto3" json:"port,omitempty"` RamSize uint32 `protobuf:"varint,4,opt,name=ramSize,proto3" json:"ramSize,omitempty"` VNumbers []uint32 `protobuf:"varint,5,rep,packed,name=vNumbers,proto3" json:"vNumbers,omitempty"` // contains filtered or unexported fields }
---------------------------------- Internal messages exchanged between nodes during gossip phase
func (*NodeState) Descriptor
deprecated
func (*NodeState) GetRamSize ¶
func (*NodeState) GetVNumbers ¶
func (*NodeState) ProtoMessage ¶
func (*NodeState) ProtoMessage()
func (*NodeState) ProtoReflect ¶
func (x *NodeState) ProtoReflect() protoreflect.Message
type Noop ¶
type Noop struct {
// contains filtered or unexported fields
}
func (*Noop) Descriptor
deprecated
func (*Noop) ProtoMessage ¶
func (*Noop) ProtoMessage()
func (*Noop) ProtoReflect ¶
func (x *Noop) ProtoReflect() protoreflect.Message
type RingState ¶
type RingState struct { NodeStates []*NodeState `protobuf:"bytes,1,rep,name=nodeStates,proto3" json:"nodeStates,omitempty"` // contains filtered or unexported fields }
func (*RingState) Descriptor
deprecated
func (*RingState) GetNodeStates ¶
func (*RingState) ProtoMessage ¶
func (*RingState) ProtoMessage()
func (*RingState) ProtoReflect ¶
func (x *RingState) ProtoReflect() protoreflect.Message
type UnimplementedCommandApiServer ¶
type UnimplementedCommandApiServer struct { }
UnimplementedCommandApiServer must be embedded to have forward compatible implementations.
func (UnimplementedCommandApiServer) Del ¶
func (UnimplementedCommandApiServer) Del(context.Context, *Command) (*CommandResponse, error)
func (UnimplementedCommandApiServer) Get ¶
func (UnimplementedCommandApiServer) Get(context.Context, *Command) (*CommandResponse, error)
func (UnimplementedCommandApiServer) Set ¶
func (UnimplementedCommandApiServer) Set(context.Context, *Command) (*CommandResponse, error)
type UnimplementedCoordinatorApiServer ¶
type UnimplementedCoordinatorApiServer struct { }
UnimplementedCoordinatorApiServer must be embedded to have forward compatible implementations.
func (UnimplementedCoordinatorApiServer) Del ¶
func (UnimplementedCoordinatorApiServer) Del(context.Context, *Command) (*CoordinatorResponse, error)
func (UnimplementedCoordinatorApiServer) Get ¶
func (UnimplementedCoordinatorApiServer) Get(context.Context, *Command) (*CoordinatorResponse, error)
func (UnimplementedCoordinatorApiServer) Set ¶
func (UnimplementedCoordinatorApiServer) Set(context.Context, *Command) (*CoordinatorResponse, error)
type UnsafeCommandApiServer ¶
type UnsafeCommandApiServer interface {
// contains filtered or unexported methods
}
UnsafeCommandApiServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to CommandApiServer will result in compilation errors.
type UnsafeCoordinatorApiServer ¶
type UnsafeCoordinatorApiServer interface {
// contains filtered or unexported methods
}
UnsafeCoordinatorApiServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to CoordinatorApiServer will result in compilation errors.