Documentation ¶
Index ¶
- Variables
- func RegisterNexusServer(s grpc.ServiceRegistrar, srv NexusServer)
- type AddNodeRequest
- 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 ListNodesResponse
- func (*ListNodesResponse) Descriptor() ([]byte, []int)deprecated
- func (x *ListNodesResponse) GetLeader() uint64
- func (x *ListNodesResponse) GetNodes() map[uint64]*models.NodeInfo
- func (x *ListNodesResponse) GetStatus() *Status
- func (*ListNodesResponse) ProtoMessage()
- func (x *ListNodesResponse) ProtoReflect() protoreflect.Message
- func (x *ListNodesResponse) Reset()
- func (x *ListNodesResponse) String() string
- type LoadRequest
- func (req *LoadRequest) Decode(data []byte) error
- func (*LoadRequest) Descriptor() ([]byte, []int)deprecated
- func (req *LoadRequest) Encode() ([]byte, error)
- func (x *LoadRequest) GetArgs() map[string][]byte
- func (x *LoadRequest) GetData() []byte
- func (*LoadRequest) ProtoMessage()
- func (x *LoadRequest) ProtoReflect() protoreflect.Message
- func (x *LoadRequest) Reset()
- func (x *LoadRequest) String() string
- type LoadResponse
- func (*LoadResponse) Descriptor() ([]byte, []int)deprecated
- func (x *LoadResponse) GetReqData() []byte
- func (x *LoadResponse) GetResData() []byte
- func (x *LoadResponse) GetStatus() *Status
- func (*LoadResponse) ProtoMessage()
- func (x *LoadResponse) ProtoReflect() protoreflect.Message
- func (x *LoadResponse) Reset()
- func (x *LoadResponse) String() string
- type NexusClient
- type NexusServer
- type RaftReplicator
- type RemoveNodeRequest
- type SaveRequest
- func (req *SaveRequest) Decode(data []byte) error
- func (*SaveRequest) Descriptor() ([]byte, []int)deprecated
- func (req *SaveRequest) Encode() ([]byte, error)
- func (x *SaveRequest) GetArgs() map[string][]byte
- func (x *SaveRequest) GetData() []byte
- func (*SaveRequest) ProtoMessage()
- func (x *SaveRequest) ProtoReflect() protoreflect.Message
- func (x *SaveRequest) Reset()
- func (x *SaveRequest) String() string
- type SaveResponse
- func (*SaveResponse) Descriptor() ([]byte, []int)deprecated
- func (x *SaveResponse) GetReqData() []byte
- func (x *SaveResponse) GetResData() []byte
- func (x *SaveResponse) GetStatus() *Status
- func (*SaveResponse) ProtoMessage()
- func (x *SaveResponse) ProtoReflect() protoreflect.Message
- func (x *SaveResponse) Reset()
- func (x *SaveResponse) String() string
- type Status
- type UnimplementedNexusServer
- func (UnimplementedNexusServer) AddNode(context.Context, *AddNodeRequest) (*Status, error)
- func (UnimplementedNexusServer) Check(context.Context, *HealthCheckRequest) (*HealthCheckResponse, error)
- func (UnimplementedNexusServer) ListNodes(context.Context, *emptypb.Empty) (*ListNodesResponse, error)
- func (UnimplementedNexusServer) Load(context.Context, *LoadRequest) (*LoadResponse, error)
- func (UnimplementedNexusServer) RemoveNode(context.Context, *RemoveNodeRequest) (*Status, error)
- func (UnimplementedNexusServer) Save(context.Context, *SaveRequest) (*SaveResponse, error)
- type UnsafeNexusServer
Constants ¶
This section is empty.
Variables ¶
var ( HealthCheckResponse_ServingStatus_name = map[int32]string{ 0: "UNKNOWN", 1: "SERVING", 2: "NOT_SERVING", } HealthCheckResponse_ServingStatus_value = map[string]int32{ "UNKNOWN": 0, "SERVING": 1, "NOT_SERVING": 2, } )
Enum value maps for HealthCheckResponse_ServingStatus.
var File_pkg_api_nexus_proto protoreflect.FileDescriptor
var Nexus_ServiceDesc = grpc.ServiceDesc{ ServiceName: "nexus.api.Nexus", HandlerType: (*NexusServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Check", Handler: _Nexus_Check_Handler, }, { MethodName: "Save", Handler: _Nexus_Save_Handler, }, { MethodName: "Load", Handler: _Nexus_Load_Handler, }, { MethodName: "AddNode", Handler: _Nexus_AddNode_Handler, }, { MethodName: "RemoveNode", Handler: _Nexus_RemoveNode_Handler, }, { MethodName: "ListNodes", Handler: _Nexus_ListNodes_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "pkg/api/nexus.proto", }
Nexus_ServiceDesc is the grpc.ServiceDesc for Nexus service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterNexusServer ¶
func RegisterNexusServer(s grpc.ServiceRegistrar, srv NexusServer)
Types ¶
type AddNodeRequest ¶
type AddNodeRequest struct { NodeUrl string `protobuf:"bytes,1,opt,name=nodeUrl,proto3" json:"nodeUrl,omitempty"` // contains filtered or unexported fields }
func (*AddNodeRequest) Descriptor
deprecated
func (*AddNodeRequest) Descriptor() ([]byte, []int)
Deprecated: Use AddNodeRequest.ProtoReflect.Descriptor instead.
func (*AddNodeRequest) GetNodeUrl ¶
func (x *AddNodeRequest) GetNodeUrl() string
func (*AddNodeRequest) ProtoMessage ¶
func (*AddNodeRequest) ProtoMessage()
func (*AddNodeRequest) ProtoReflect ¶
func (x *AddNodeRequest) ProtoReflect() protoreflect.Message
func (*AddNodeRequest) Reset ¶
func (x *AddNodeRequest) Reset()
func (*AddNodeRequest) String ¶
func (x *AddNodeRequest) String() string
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=nexus.api.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 )
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 ListNodesResponse ¶
type ListNodesResponse struct { Status *Status `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` Leader uint64 `protobuf:"varint,2,opt,name=leader,proto3" json:"leader,omitempty"` Nodes map[uint64]*models.NodeInfo `` /* 152-byte string literal not displayed */ // contains filtered or unexported fields }
func (*ListNodesResponse) Descriptor
deprecated
func (*ListNodesResponse) Descriptor() ([]byte, []int)
Deprecated: Use ListNodesResponse.ProtoReflect.Descriptor instead.
func (*ListNodesResponse) GetLeader ¶
func (x *ListNodesResponse) GetLeader() uint64
func (*ListNodesResponse) GetNodes ¶
func (x *ListNodesResponse) GetNodes() map[uint64]*models.NodeInfo
func (*ListNodesResponse) GetStatus ¶
func (x *ListNodesResponse) GetStatus() *Status
func (*ListNodesResponse) ProtoMessage ¶
func (*ListNodesResponse) ProtoMessage()
func (*ListNodesResponse) ProtoReflect ¶
func (x *ListNodesResponse) ProtoReflect() protoreflect.Message
func (*ListNodesResponse) Reset ¶
func (x *ListNodesResponse) Reset()
func (*ListNodesResponse) String ¶
func (x *ListNodesResponse) String() string
type LoadRequest ¶
type LoadRequest struct { Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` Args map[string][]byte `` /* 149-byte string literal not displayed */ // contains filtered or unexported fields }
func (*LoadRequest) Decode ¶
func (req *LoadRequest) Decode(data []byte) error
func (*LoadRequest) Descriptor
deprecated
func (*LoadRequest) Descriptor() ([]byte, []int)
Deprecated: Use LoadRequest.ProtoReflect.Descriptor instead.
func (*LoadRequest) Encode ¶
func (req *LoadRequest) Encode() ([]byte, error)
func (*LoadRequest) GetArgs ¶
func (x *LoadRequest) GetArgs() map[string][]byte
func (*LoadRequest) GetData ¶
func (x *LoadRequest) GetData() []byte
func (*LoadRequest) ProtoMessage ¶
func (*LoadRequest) ProtoMessage()
func (*LoadRequest) ProtoReflect ¶
func (x *LoadRequest) ProtoReflect() protoreflect.Message
func (*LoadRequest) Reset ¶
func (x *LoadRequest) Reset()
func (*LoadRequest) String ¶
func (x *LoadRequest) String() string
type LoadResponse ¶
type LoadResponse struct { Status *Status `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` ReqData []byte `protobuf:"bytes,2,opt,name=reqData,proto3" json:"reqData,omitempty"` ResData []byte `protobuf:"bytes,3,opt,name=resData,proto3" json:"resData,omitempty"` // contains filtered or unexported fields }
func (*LoadResponse) Descriptor
deprecated
func (*LoadResponse) Descriptor() ([]byte, []int)
Deprecated: Use LoadResponse.ProtoReflect.Descriptor instead.
func (*LoadResponse) GetReqData ¶
func (x *LoadResponse) GetReqData() []byte
func (*LoadResponse) GetResData ¶
func (x *LoadResponse) GetResData() []byte
func (*LoadResponse) GetStatus ¶
func (x *LoadResponse) GetStatus() *Status
func (*LoadResponse) ProtoMessage ¶
func (*LoadResponse) ProtoMessage()
func (*LoadResponse) ProtoReflect ¶
func (x *LoadResponse) ProtoReflect() protoreflect.Message
func (*LoadResponse) Reset ¶
func (x *LoadResponse) Reset()
func (*LoadResponse) String ¶
func (x *LoadResponse) String() string
type NexusClient ¶
type NexusClient interface { Check(ctx context.Context, in *HealthCheckRequest, opts ...grpc.CallOption) (*HealthCheckResponse, error) Save(ctx context.Context, in *SaveRequest, opts ...grpc.CallOption) (*SaveResponse, error) Load(ctx context.Context, in *LoadRequest, opts ...grpc.CallOption) (*LoadResponse, error) AddNode(ctx context.Context, in *AddNodeRequest, opts ...grpc.CallOption) (*Status, error) RemoveNode(ctx context.Context, in *RemoveNodeRequest, opts ...grpc.CallOption) (*Status, error) ListNodes(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*ListNodesResponse, error) }
NexusClient is the client API for Nexus 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 NewNexusClient ¶
func NewNexusClient(cc grpc.ClientConnInterface) NexusClient
type NexusServer ¶
type NexusServer interface { Check(context.Context, *HealthCheckRequest) (*HealthCheckResponse, error) Save(context.Context, *SaveRequest) (*SaveResponse, error) Load(context.Context, *LoadRequest) (*LoadResponse, error) AddNode(context.Context, *AddNodeRequest) (*Status, error) RemoveNode(context.Context, *RemoveNodeRequest) (*Status, error) ListNodes(context.Context, *emptypb.Empty) (*ListNodesResponse, error) }
NexusServer is the server API for Nexus service. All implementations should embed UnimplementedNexusServer for forward compatibility
type RaftReplicator ¶
type RaftReplicator interface { Start() Id() uint64 Save(context.Context, []byte) ([]byte, error) Load(context.Context, []byte) ([]byte, error) AddMember(context.Context, string) error RemoveMember(context.Context, string) error ListMembers() (uint64, map[uint64]*models.NodeInfo) Stop() }
func NewRaftReplicator ¶
type RemoveNodeRequest ¶
type RemoveNodeRequest struct { NodeUrl string `protobuf:"bytes,1,opt,name=nodeUrl,proto3" json:"nodeUrl,omitempty"` // contains filtered or unexported fields }
func (*RemoveNodeRequest) Descriptor
deprecated
func (*RemoveNodeRequest) Descriptor() ([]byte, []int)
Deprecated: Use RemoveNodeRequest.ProtoReflect.Descriptor instead.
func (*RemoveNodeRequest) GetNodeUrl ¶
func (x *RemoveNodeRequest) GetNodeUrl() string
func (*RemoveNodeRequest) ProtoMessage ¶
func (*RemoveNodeRequest) ProtoMessage()
func (*RemoveNodeRequest) ProtoReflect ¶
func (x *RemoveNodeRequest) ProtoReflect() protoreflect.Message
func (*RemoveNodeRequest) Reset ¶
func (x *RemoveNodeRequest) Reset()
func (*RemoveNodeRequest) String ¶
func (x *RemoveNodeRequest) String() string
type SaveRequest ¶
type SaveRequest struct { Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` Args map[string][]byte `` /* 149-byte string literal not displayed */ // contains filtered or unexported fields }
func (*SaveRequest) Decode ¶
func (req *SaveRequest) Decode(data []byte) error
func (*SaveRequest) Descriptor
deprecated
func (*SaveRequest) Descriptor() ([]byte, []int)
Deprecated: Use SaveRequest.ProtoReflect.Descriptor instead.
func (*SaveRequest) Encode ¶
func (req *SaveRequest) Encode() ([]byte, error)
func (*SaveRequest) GetArgs ¶
func (x *SaveRequest) GetArgs() map[string][]byte
func (*SaveRequest) GetData ¶
func (x *SaveRequest) GetData() []byte
func (*SaveRequest) ProtoMessage ¶
func (*SaveRequest) ProtoMessage()
func (*SaveRequest) ProtoReflect ¶
func (x *SaveRequest) ProtoReflect() protoreflect.Message
func (*SaveRequest) Reset ¶
func (x *SaveRequest) Reset()
func (*SaveRequest) String ¶
func (x *SaveRequest) String() string
type SaveResponse ¶
type SaveResponse struct { Status *Status `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` ReqData []byte `protobuf:"bytes,2,opt,name=reqData,proto3" json:"reqData,omitempty"` ResData []byte `protobuf:"bytes,3,opt,name=resData,proto3" json:"resData,omitempty"` // contains filtered or unexported fields }
func (*SaveResponse) Descriptor
deprecated
func (*SaveResponse) Descriptor() ([]byte, []int)
Deprecated: Use SaveResponse.ProtoReflect.Descriptor instead.
func (*SaveResponse) GetReqData ¶
func (x *SaveResponse) GetReqData() []byte
func (*SaveResponse) GetResData ¶
func (x *SaveResponse) GetResData() []byte
func (*SaveResponse) GetStatus ¶
func (x *SaveResponse) GetStatus() *Status
func (*SaveResponse) ProtoMessage ¶
func (*SaveResponse) ProtoMessage()
func (*SaveResponse) ProtoReflect ¶
func (x *SaveResponse) ProtoReflect() protoreflect.Message
func (*SaveResponse) Reset ¶
func (x *SaveResponse) Reset()
func (*SaveResponse) String ¶
func (x *SaveResponse) String() string
type Status ¶
type Status struct { Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` // contains filtered or unexported fields }
func (*Status) Descriptor
deprecated
func (*Status) GetMessage ¶
func (*Status) ProtoMessage ¶
func (*Status) ProtoMessage()
func (*Status) ProtoReflect ¶
func (x *Status) ProtoReflect() protoreflect.Message
type UnimplementedNexusServer ¶
type UnimplementedNexusServer struct { }
UnimplementedNexusServer should be embedded to have forward compatible implementations.
func (UnimplementedNexusServer) AddNode ¶
func (UnimplementedNexusServer) AddNode(context.Context, *AddNodeRequest) (*Status, error)
func (UnimplementedNexusServer) Check ¶
func (UnimplementedNexusServer) Check(context.Context, *HealthCheckRequest) (*HealthCheckResponse, error)
func (UnimplementedNexusServer) ListNodes ¶
func (UnimplementedNexusServer) ListNodes(context.Context, *emptypb.Empty) (*ListNodesResponse, error)
func (UnimplementedNexusServer) Load ¶
func (UnimplementedNexusServer) Load(context.Context, *LoadRequest) (*LoadResponse, error)
func (UnimplementedNexusServer) RemoveNode ¶
func (UnimplementedNexusServer) RemoveNode(context.Context, *RemoveNodeRequest) (*Status, error)
func (UnimplementedNexusServer) Save ¶
func (UnimplementedNexusServer) Save(context.Context, *SaveRequest) (*SaveResponse, error)
type UnsafeNexusServer ¶
type UnsafeNexusServer interface {
// contains filtered or unexported methods
}
UnsafeNexusServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to NexusServer will result in compilation errors.