serverpb

package
v0.9.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 17, 2024 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	RaftLogCommand_name = map[int32]string{
		0: "SetWithTTL",
		1: "TrySetWithTTL",
		2: "Set",
		3: "TrySet",
		4: "Del",
	}
	RaftLogCommand_value = map[string]int32{
		"SetWithTTL":    0,
		"TrySetWithTTL": 1,
		"Set":           2,
		"TrySet":        3,
		"Del":           4,
	}
)

Enum value maps for RaftLogCommand.

View Source
var (
	RaftState_name = map[int32]string{
		0: "follower",
		1: "candidate",
		2: "leader",
		3: "shutdown",
		4: "unknown",
	}
	RaftState_value = map[string]int32{
		"follower":  0,
		"candidate": 1,
		"leader":    2,
		"shutdown":  3,
		"unknown":   4,
	}
)

Enum value maps for RaftState.

View Source
var File_api_serverpb_node_proto protoreflect.FileDescriptor
View Source
var File_api_serverpb_rpc_proto protoreflect.FileDescriptor
View Source
var KV_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "serverpb.KV",
	HandlerType: (*KVServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Set",
			Handler:    _KV_Set_Handler,
		},
		{
			MethodName: "Get",
			Handler:    _KV_Get_Handler,
		},
		{
			MethodName: "PrefixScan",
			Handler:    _KV_PrefixScan_Handler,
		},
		{
			MethodName: "TrySet",
			Handler:    _KV_TrySet_Handler,
		},
		{
			MethodName: "Delete",
			Handler:    _KV_Delete_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "Watch",
			Handler:       _KV_Watch_Handler,
			ServerStreams: true,
		},
		{
			StreamName:    "WatchPrefix",
			Handler:       _KV_WatchPrefix_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "api/serverpb/rpc.proto",
}

KV_ServiceDesc is the grpc.ServiceDesc for KV service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

View Source
var Locker_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "serverpb.Locker",
	HandlerType: (*LockerServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Lock",
			Handler:    _Locker_Lock_Handler,
		},
		{
			MethodName: "Unlock",
			Handler:    _Locker_Unlock_Handler,
		},
		{
			MethodName: "TryLock",
			Handler:    _Locker_TryLock_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "api/serverpb/rpc.proto",
}

Locker_ServiceDesc is the grpc.ServiceDesc for Locker service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

View Source
var RedQueen_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "serverpb.RedQueen",
	HandlerType: (*RedQueenServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "AppendCluster",
			Handler:    _RedQueen_AppendCluster_Handler,
		},
		{
			MethodName: "RaftState",
			Handler:    _RedQueen_RaftState_Handler,
		},
		{
			MethodName: "RaftSnapshot",
			Handler:    _RedQueen_RaftSnapshot_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "LeaderMonitor",
			Handler:       _RedQueen_LeaderMonitor_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "api/serverpb/node.proto",
}

RedQueen_ServiceDesc is the grpc.ServiceDesc for RedQueen service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterKVServer

func RegisterKVServer(s grpc.ServiceRegistrar, srv KVServer)

func RegisterLockerServer

func RegisterLockerServer(s grpc.ServiceRegistrar, srv LockerServer)

func RegisterRedQueenServer

func RegisterRedQueenServer(s grpc.ServiceRegistrar, srv RedQueenServer)

Types

type AppendClusterRequest

type AppendClusterRequest struct {
	ServerId string `protobuf:"bytes,1,opt,name=server_id,json=serverId,proto3" json:"server_id,omitempty"`
	PeerAddr string `protobuf:"bytes,2,opt,name=peer_addr,json=peerAddr,proto3" json:"peer_addr,omitempty"`
	Voter    bool   `protobuf:"varint,3,opt,name=voter,proto3" json:"voter,omitempty"`
	// contains filtered or unexported fields
}

func (*AppendClusterRequest) Descriptor deprecated

func (*AppendClusterRequest) Descriptor() ([]byte, []int)

Deprecated: Use AppendClusterRequest.ProtoReflect.Descriptor instead.

func (*AppendClusterRequest) GetPeerAddr

func (x *AppendClusterRequest) GetPeerAddr() string

func (*AppendClusterRequest) GetServerId

func (x *AppendClusterRequest) GetServerId() string

func (*AppendClusterRequest) GetVoter

func (x *AppendClusterRequest) GetVoter() bool

func (*AppendClusterRequest) ProtoMessage

func (*AppendClusterRequest) ProtoMessage()

func (*AppendClusterRequest) ProtoReflect

func (x *AppendClusterRequest) ProtoReflect() protoreflect.Message

func (*AppendClusterRequest) Reset

func (x *AppendClusterRequest) Reset()

func (*AppendClusterRequest) String

func (x *AppendClusterRequest) String() string

type AppendClusterResponse

type AppendClusterResponse struct {
	// contains filtered or unexported fields
}

func (*AppendClusterResponse) Descriptor deprecated

func (*AppendClusterResponse) Descriptor() ([]byte, []int)

Deprecated: Use AppendClusterResponse.ProtoReflect.Descriptor instead.

func (*AppendClusterResponse) ProtoMessage

func (*AppendClusterResponse) ProtoMessage()

func (*AppendClusterResponse) ProtoReflect

func (x *AppendClusterResponse) ProtoReflect() protoreflect.Message

func (*AppendClusterResponse) Reset

func (x *AppendClusterResponse) Reset()

func (*AppendClusterResponse) String

func (x *AppendClusterResponse) String() string

type DeleteRequest

type DeleteRequest struct {

	// key is the key, in bytes, to delete into the key-value store.
	Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	// namespace means the same key-value store can exist in different namespaces
	Namespace *string `protobuf:"bytes,2,opt,name=namespace,proto3,oneof" json:"namespace,omitempty"`
	// contains filtered or unexported fields
}

func (*DeleteRequest) Descriptor deprecated

func (*DeleteRequest) Descriptor() ([]byte, []int)

Deprecated: Use DeleteRequest.ProtoReflect.Descriptor instead.

func (*DeleteRequest) GetKey

func (x *DeleteRequest) GetKey() []byte

func (*DeleteRequest) GetNamespace

func (x *DeleteRequest) GetNamespace() string

func (*DeleteRequest) ProtoMessage

func (*DeleteRequest) ProtoMessage()

func (*DeleteRequest) ProtoReflect

func (x *DeleteRequest) ProtoReflect() protoreflect.Message

func (*DeleteRequest) Reset

func (x *DeleteRequest) Reset()

func (*DeleteRequest) String

func (x *DeleteRequest) String() string

type DeleteResponse

type DeleteResponse struct {
	Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"`
	// contains filtered or unexported fields
}

func (*DeleteResponse) Descriptor deprecated

func (*DeleteResponse) Descriptor() ([]byte, []int)

Deprecated: Use DeleteResponse.ProtoReflect.Descriptor instead.

func (*DeleteResponse) GetHeader

func (x *DeleteResponse) GetHeader() *ResponseHeader

func (*DeleteResponse) ProtoMessage

func (*DeleteResponse) ProtoMessage()

func (*DeleteResponse) ProtoReflect

func (x *DeleteResponse) ProtoReflect() protoreflect.Message

func (*DeleteResponse) Reset

func (x *DeleteResponse) Reset()

func (*DeleteResponse) String

func (x *DeleteResponse) String() string

type GetRequest

type GetRequest struct {

	// key is the key, in bytes, to set into the key-value store.
	Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	// namespace means the same key-value store can exist in different namespaces
	Namespace *string `protobuf:"bytes,2,opt,name=namespace,proto3,oneof" json:"namespace,omitempty"`
	// contains filtered or unexported fields
}

func (*GetRequest) Descriptor deprecated

func (*GetRequest) Descriptor() ([]byte, []int)

Deprecated: Use GetRequest.ProtoReflect.Descriptor instead.

func (*GetRequest) GetKey

func (x *GetRequest) GetKey() []byte

func (*GetRequest) GetNamespace

func (x *GetRequest) GetNamespace() string

func (*GetRequest) ProtoMessage

func (*GetRequest) ProtoMessage()

func (*GetRequest) ProtoReflect

func (x *GetRequest) ProtoReflect() protoreflect.Message

func (*GetRequest) Reset

func (x *GetRequest) Reset()

func (*GetRequest) String

func (x *GetRequest) String() string

type GetResponse

type GetResponse struct {
	Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"`
	Value  []byte          `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
	Ttl    uint32          `protobuf:"varint,3,opt,name=ttl,proto3" json:"ttl,omitempty"`
	// contains filtered or unexported fields
}

func (*GetResponse) Descriptor deprecated

func (*GetResponse) Descriptor() ([]byte, []int)

Deprecated: Use GetResponse.ProtoReflect.Descriptor instead.

func (*GetResponse) GetHeader

func (x *GetResponse) GetHeader() *ResponseHeader

func (*GetResponse) GetTtl

func (x *GetResponse) GetTtl() uint32

func (*GetResponse) GetValue

func (x *GetResponse) GetValue() []byte

func (*GetResponse) ProtoMessage

func (*GetResponse) ProtoMessage()

func (*GetResponse) ProtoReflect

func (x *GetResponse) ProtoReflect() protoreflect.Message

func (*GetResponse) Reset

func (x *GetResponse) Reset()

func (*GetResponse) String

func (x *GetResponse) String() string

type KVClient

type KVClient interface {
	Set(ctx context.Context, in *SetRequest, opts ...grpc.CallOption) (*SetResponse, error)
	Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetResponse, error)
	PrefixScan(ctx context.Context, in *PrefixScanRequest, opts ...grpc.CallOption) (*PrefixScanResponse, error)
	TrySet(ctx context.Context, in *SetRequest, opts ...grpc.CallOption) (*SetResponse, error)
	Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*DeleteResponse, error)
	Watch(ctx context.Context, in *WatchRequest, opts ...grpc.CallOption) (KV_WatchClient, error)
	WatchPrefix(ctx context.Context, in *WatchPrefixRequest, opts ...grpc.CallOption) (KV_WatchPrefixClient, error)
}

KVClient is the client API for KV 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 NewKVClient

func NewKVClient(cc grpc.ClientConnInterface) KVClient

type KVServer

KVServer is the server API for KV service. All implementations must embed UnimplementedKVServer for forward compatibility

type KV_WatchClient

type KV_WatchClient interface {
	Recv() (*WatchResponse, error)
	grpc.ClientStream
}

type KV_WatchPrefixClient added in v0.5.1

type KV_WatchPrefixClient interface {
	Recv() (*WatchResponse, error)
	grpc.ClientStream
}

type KV_WatchPrefixServer added in v0.5.1

type KV_WatchPrefixServer interface {
	Send(*WatchResponse) error
	grpc.ServerStream
}

type KV_WatchServer

type KV_WatchServer interface {
	Send(*WatchResponse) error
	grpc.ServerStream
}

type LeaderMonitorRequest

type LeaderMonitorRequest struct {
	// contains filtered or unexported fields
}

func (*LeaderMonitorRequest) Descriptor deprecated

func (*LeaderMonitorRequest) Descriptor() ([]byte, []int)

Deprecated: Use LeaderMonitorRequest.ProtoReflect.Descriptor instead.

func (*LeaderMonitorRequest) ProtoMessage

func (*LeaderMonitorRequest) ProtoMessage()

func (*LeaderMonitorRequest) ProtoReflect

func (x *LeaderMonitorRequest) ProtoReflect() protoreflect.Message

func (*LeaderMonitorRequest) Reset

func (x *LeaderMonitorRequest) Reset()

func (*LeaderMonitorRequest) String

func (x *LeaderMonitorRequest) String() string

type LeaderMonitorResponse

type LeaderMonitorResponse struct {
	Leader bool `protobuf:"varint,1,opt,name=leader,proto3" json:"leader,omitempty"`
	// contains filtered or unexported fields
}

func (*LeaderMonitorResponse) Descriptor deprecated

func (*LeaderMonitorResponse) Descriptor() ([]byte, []int)

Deprecated: Use LeaderMonitorResponse.ProtoReflect.Descriptor instead.

func (*LeaderMonitorResponse) GetLeader

func (x *LeaderMonitorResponse) GetLeader() bool

func (*LeaderMonitorResponse) ProtoMessage

func (*LeaderMonitorResponse) ProtoMessage()

func (*LeaderMonitorResponse) ProtoReflect

func (x *LeaderMonitorResponse) ProtoReflect() protoreflect.Message

func (*LeaderMonitorResponse) Reset

func (x *LeaderMonitorResponse) Reset()

func (*LeaderMonitorResponse) String

func (x *LeaderMonitorResponse) String() string

type LockRequest

type LockRequest struct {
	LockId string `protobuf:"bytes,1,opt,name=lock_id,json=lockId,proto3" json:"lock_id,omitempty"`
	// ttl indicates the ttl time of this key-value store.
	// -1 means never ttl, the unit is second.
	Ttl int32 `protobuf:"varint,2,opt,name=ttl,proto3" json:"ttl,omitempty"`
	// contains filtered or unexported fields
}

--------------- Locker --------------- //

func (*LockRequest) Descriptor deprecated

func (*LockRequest) Descriptor() ([]byte, []int)

Deprecated: Use LockRequest.ProtoReflect.Descriptor instead.

func (*LockRequest) GetLockId

func (x *LockRequest) GetLockId() string

func (*LockRequest) GetTtl

func (x *LockRequest) GetTtl() int32

func (*LockRequest) ProtoMessage

func (*LockRequest) ProtoMessage()

func (*LockRequest) ProtoReflect

func (x *LockRequest) ProtoReflect() protoreflect.Message

func (*LockRequest) Reset

func (x *LockRequest) Reset()

func (*LockRequest) String

func (x *LockRequest) String() string

type LockResponse

type LockResponse struct {
	Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"`
	// contains filtered or unexported fields
}

func (*LockResponse) Descriptor deprecated

func (*LockResponse) Descriptor() ([]byte, []int)

Deprecated: Use LockResponse.ProtoReflect.Descriptor instead.

func (*LockResponse) GetHeader

func (x *LockResponse) GetHeader() *ResponseHeader

func (*LockResponse) ProtoMessage

func (*LockResponse) ProtoMessage()

func (*LockResponse) ProtoReflect

func (x *LockResponse) ProtoReflect() protoreflect.Message

func (*LockResponse) Reset

func (x *LockResponse) Reset()

func (*LockResponse) String

func (x *LockResponse) String() string

type LockerClient

type LockerClient interface {
	Lock(ctx context.Context, in *LockRequest, opts ...grpc.CallOption) (*LockResponse, error)
	Unlock(ctx context.Context, in *UnlockRequest, opts ...grpc.CallOption) (*UnlockResponse, error)
	TryLock(ctx context.Context, in *TryLockRequest, opts ...grpc.CallOption) (*TryLockResponse, error)
}

LockerClient is the client API for Locker 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 NewLockerClient

func NewLockerClient(cc grpc.ClientConnInterface) LockerClient

type LockerServer

type LockerServer interface {
	Lock(context.Context, *LockRequest) (*LockResponse, error)
	Unlock(context.Context, *UnlockRequest) (*UnlockResponse, error)
	TryLock(context.Context, *TryLockRequest) (*TryLockResponse, error)
	// contains filtered or unexported methods
}

LockerServer is the server API for Locker service. All implementations must embed UnimplementedLockerServer for forward compatibility

type PrefixScanRequest

type PrefixScanRequest struct {
	Prefix    []byte  `protobuf:"bytes,1,opt,name=prefix,proto3" json:"prefix,omitempty"`
	Offset    uint64  `protobuf:"varint,2,opt,name=offset,proto3" json:"offset,omitempty"`
	Limit     uint64  `protobuf:"varint,3,opt,name=limit,proto3" json:"limit,omitempty"`
	Reg       *string `protobuf:"bytes,4,opt,name=reg,proto3,oneof" json:"reg,omitempty"`
	Namespace *string `protobuf:"bytes,5,opt,name=namespace,proto3,oneof" json:"namespace,omitempty"`
	// contains filtered or unexported fields
}

func (*PrefixScanRequest) Descriptor deprecated

func (*PrefixScanRequest) Descriptor() ([]byte, []int)

Deprecated: Use PrefixScanRequest.ProtoReflect.Descriptor instead.

func (*PrefixScanRequest) GetLimit

func (x *PrefixScanRequest) GetLimit() uint64

func (*PrefixScanRequest) GetNamespace

func (x *PrefixScanRequest) GetNamespace() string

func (*PrefixScanRequest) GetOffset

func (x *PrefixScanRequest) GetOffset() uint64

func (*PrefixScanRequest) GetPrefix

func (x *PrefixScanRequest) GetPrefix() []byte

func (*PrefixScanRequest) GetReg

func (x *PrefixScanRequest) GetReg() string

func (*PrefixScanRequest) ProtoMessage

func (*PrefixScanRequest) ProtoMessage()

func (*PrefixScanRequest) ProtoReflect

func (x *PrefixScanRequest) ProtoReflect() protoreflect.Message

func (*PrefixScanRequest) Reset

func (x *PrefixScanRequest) Reset()

func (*PrefixScanRequest) String

func (x *PrefixScanRequest) String() string

type PrefixScanResponse

type PrefixScanResponse struct {
	Header *ResponseHeader                        `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"`
	Result []*PrefixScanResponse_PrefixScanResult `protobuf:"bytes,2,rep,name=result,proto3" json:"result,omitempty"`
	// contains filtered or unexported fields
}

func (*PrefixScanResponse) Descriptor deprecated

func (*PrefixScanResponse) Descriptor() ([]byte, []int)

Deprecated: Use PrefixScanResponse.ProtoReflect.Descriptor instead.

func (*PrefixScanResponse) GetHeader

func (x *PrefixScanResponse) GetHeader() *ResponseHeader

func (*PrefixScanResponse) GetResult

func (*PrefixScanResponse) ProtoMessage

func (*PrefixScanResponse) ProtoMessage()

func (*PrefixScanResponse) ProtoReflect

func (x *PrefixScanResponse) ProtoReflect() protoreflect.Message

func (*PrefixScanResponse) Reset

func (x *PrefixScanResponse) Reset()

func (*PrefixScanResponse) String

func (x *PrefixScanResponse) String() string

type PrefixScanResponse_PrefixScanResult

type PrefixScanResponse_PrefixScanResult struct {
	Key       []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	Value     []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
	Timestamp uint64 `protobuf:"varint,3,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
	Ttl       uint32 `protobuf:"varint,4,opt,name=ttl,proto3" json:"ttl,omitempty"`
	// contains filtered or unexported fields
}

func (*PrefixScanResponse_PrefixScanResult) Descriptor deprecated

func (*PrefixScanResponse_PrefixScanResult) Descriptor() ([]byte, []int)

Deprecated: Use PrefixScanResponse_PrefixScanResult.ProtoReflect.Descriptor instead.

func (*PrefixScanResponse_PrefixScanResult) GetKey

func (*PrefixScanResponse_PrefixScanResult) GetTimestamp

func (x *PrefixScanResponse_PrefixScanResult) GetTimestamp() uint64

func (*PrefixScanResponse_PrefixScanResult) GetTtl

func (*PrefixScanResponse_PrefixScanResult) GetValue

func (x *PrefixScanResponse_PrefixScanResult) GetValue() []byte

func (*PrefixScanResponse_PrefixScanResult) ProtoMessage

func (*PrefixScanResponse_PrefixScanResult) ProtoMessage()

func (*PrefixScanResponse_PrefixScanResult) ProtoReflect

func (*PrefixScanResponse_PrefixScanResult) Reset

func (*PrefixScanResponse_PrefixScanResult) String

type RaftLogCommand

type RaftLogCommand int32
const (
	RaftLogCommand_SetWithTTL    RaftLogCommand = 0
	RaftLogCommand_TrySetWithTTL RaftLogCommand = 1
	RaftLogCommand_Set           RaftLogCommand = 2
	RaftLogCommand_TrySet        RaftLogCommand = 3
	RaftLogCommand_Del           RaftLogCommand = 4
)

func (RaftLogCommand) Descriptor

func (RaftLogCommand) Enum

func (x RaftLogCommand) Enum() *RaftLogCommand

func (RaftLogCommand) EnumDescriptor deprecated

func (RaftLogCommand) EnumDescriptor() ([]byte, []int)

Deprecated: Use RaftLogCommand.Descriptor instead.

func (RaftLogCommand) Number

func (RaftLogCommand) String

func (x RaftLogCommand) String() string

func (RaftLogCommand) Type

type RaftLogPayload

type RaftLogPayload struct {
	Command   RaftLogCommand `protobuf:"varint,1,opt,name=command,proto3,enum=serverpb.RaftLogCommand" json:"command,omitempty"`
	Key       []byte         `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"`
	Value     []byte         `protobuf:"bytes,3,opt,name=value,proto3,oneof" json:"value,omitempty"`
	Ttl       *uint32        `protobuf:"varint,4,opt,name=ttl,proto3,oneof" json:"ttl,omitempty"`
	Namespace *string        `protobuf:"bytes,5,opt,name=namespace,proto3,oneof" json:"namespace,omitempty"`
	// contains filtered or unexported fields
}

func (*RaftLogPayload) Descriptor deprecated

func (*RaftLogPayload) Descriptor() ([]byte, []int)

Deprecated: Use RaftLogPayload.ProtoReflect.Descriptor instead.

func (*RaftLogPayload) GetCommand

func (x *RaftLogPayload) GetCommand() RaftLogCommand

func (*RaftLogPayload) GetKey

func (x *RaftLogPayload) GetKey() []byte

func (*RaftLogPayload) GetNamespace

func (x *RaftLogPayload) GetNamespace() string

func (*RaftLogPayload) GetTtl

func (x *RaftLogPayload) GetTtl() uint32

func (*RaftLogPayload) GetValue

func (x *RaftLogPayload) GetValue() []byte

func (*RaftLogPayload) ProtoMessage

func (*RaftLogPayload) ProtoMessage()

func (*RaftLogPayload) ProtoReflect

func (x *RaftLogPayload) ProtoReflect() protoreflect.Message

func (*RaftLogPayload) Reset

func (x *RaftLogPayload) Reset()

func (*RaftLogPayload) String

func (x *RaftLogPayload) String() string

type RaftSnapshotRequest added in v0.7.0

type RaftSnapshotRequest struct {
	Path *string `protobuf:"bytes,1,opt,name=path,proto3,oneof" json:"path,omitempty"`
	// contains filtered or unexported fields
}

func (*RaftSnapshotRequest) Descriptor deprecated added in v0.7.0

func (*RaftSnapshotRequest) Descriptor() ([]byte, []int)

Deprecated: Use RaftSnapshotRequest.ProtoReflect.Descriptor instead.

func (*RaftSnapshotRequest) GetPath added in v0.7.0

func (x *RaftSnapshotRequest) GetPath() string

func (*RaftSnapshotRequest) ProtoMessage added in v0.7.0

func (*RaftSnapshotRequest) ProtoMessage()

func (*RaftSnapshotRequest) ProtoReflect added in v0.7.0

func (x *RaftSnapshotRequest) ProtoReflect() protoreflect.Message

func (*RaftSnapshotRequest) Reset added in v0.7.0

func (x *RaftSnapshotRequest) Reset()

func (*RaftSnapshotRequest) String added in v0.7.0

func (x *RaftSnapshotRequest) String() string

type RaftState

type RaftState int32
const (
	RaftState_follower  RaftState = 0
	RaftState_candidate RaftState = 1
	RaftState_leader    RaftState = 2
	RaftState_shutdown  RaftState = 3
	RaftState_unknown   RaftState = 4
)

func (RaftState) Descriptor

func (RaftState) Descriptor() protoreflect.EnumDescriptor

func (RaftState) Enum

func (x RaftState) Enum() *RaftState

func (RaftState) EnumDescriptor deprecated

func (RaftState) EnumDescriptor() ([]byte, []int)

Deprecated: Use RaftState.Descriptor instead.

func (RaftState) Number

func (x RaftState) Number() protoreflect.EnumNumber

func (RaftState) String

func (x RaftState) String() string

func (RaftState) Type

type RaftStateRequest

type RaftStateRequest struct {
	// contains filtered or unexported fields
}

func (*RaftStateRequest) Descriptor deprecated

func (*RaftStateRequest) Descriptor() ([]byte, []int)

Deprecated: Use RaftStateRequest.ProtoReflect.Descriptor instead.

func (*RaftStateRequest) ProtoMessage

func (*RaftStateRequest) ProtoMessage()

func (*RaftStateRequest) ProtoReflect

func (x *RaftStateRequest) ProtoReflect() protoreflect.Message

func (*RaftStateRequest) Reset

func (x *RaftStateRequest) Reset()

func (*RaftStateRequest) String

func (x *RaftStateRequest) String() string

type RaftStateResponse

type RaftStateResponse struct {
	State RaftState `protobuf:"varint,1,opt,name=state,proto3,enum=serverpb.RaftState" json:"state,omitempty"`
	// contains filtered or unexported fields
}

func (*RaftStateResponse) Descriptor deprecated

func (*RaftStateResponse) Descriptor() ([]byte, []int)

Deprecated: Use RaftStateResponse.ProtoReflect.Descriptor instead.

func (*RaftStateResponse) GetState

func (x *RaftStateResponse) GetState() RaftState

func (*RaftStateResponse) ProtoMessage

func (*RaftStateResponse) ProtoMessage()

func (*RaftStateResponse) ProtoReflect

func (x *RaftStateResponse) ProtoReflect() protoreflect.Message

func (*RaftStateResponse) Reset

func (x *RaftStateResponse) Reset()

func (*RaftStateResponse) String

func (x *RaftStateResponse) String() string

type RedQueenClient

type RedQueenClient interface {
	AppendCluster(ctx context.Context, in *AppendClusterRequest, opts ...grpc.CallOption) (*AppendClusterResponse, error)
	LeaderMonitor(ctx context.Context, in *LeaderMonitorRequest, opts ...grpc.CallOption) (RedQueen_LeaderMonitorClient, error)
	RaftState(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*RaftStateResponse, error)
	RaftSnapshot(ctx context.Context, in *RaftSnapshotRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
}

RedQueenClient is the client API for RedQueen 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 NewRedQueenClient

func NewRedQueenClient(cc grpc.ClientConnInterface) RedQueenClient

type RedQueenServer

type RedQueenServer interface {
	AppendCluster(context.Context, *AppendClusterRequest) (*AppendClusterResponse, error)
	LeaderMonitor(*LeaderMonitorRequest, RedQueen_LeaderMonitorServer) error
	RaftState(context.Context, *emptypb.Empty) (*RaftStateResponse, error)
	RaftSnapshot(context.Context, *RaftSnapshotRequest) (*emptypb.Empty, error)
	// contains filtered or unexported methods
}

RedQueenServer is the server API for RedQueen service. All implementations must embed UnimplementedRedQueenServer for forward compatibility

type RedQueen_LeaderMonitorClient

type RedQueen_LeaderMonitorClient interface {
	Recv() (*LeaderMonitorResponse, error)
	grpc.ClientStream
}

type RedQueen_LeaderMonitorServer

type RedQueen_LeaderMonitorServer interface {
	Send(*LeaderMonitorResponse) error
	grpc.ServerStream
}

type ResponseHeader

type ResponseHeader struct {

	// cluster_id is the ID of the cluster which sent the response.
	ClusterId string `protobuf:"bytes,1,opt,name=cluster_id,json=clusterId,proto3" json:"cluster_id,omitempty"`
	// reserve field
	Revision uint64 `protobuf:"varint,2,opt,name=revision,proto3" json:"revision,omitempty"`
	// raft_term is the raft term when the request was applied.
	RaftTerm uint64 `protobuf:"varint,3,opt,name=raft_term,json=raftTerm,proto3" json:"raft_term,omitempty"`
	// contains filtered or unexported fields
}

--------------- Public --------------- //

func (*ResponseHeader) Descriptor deprecated

func (*ResponseHeader) Descriptor() ([]byte, []int)

Deprecated: Use ResponseHeader.ProtoReflect.Descriptor instead.

func (*ResponseHeader) GetClusterId

func (x *ResponseHeader) GetClusterId() string

func (*ResponseHeader) GetRaftTerm

func (x *ResponseHeader) GetRaftTerm() uint64

func (*ResponseHeader) GetRevision

func (x *ResponseHeader) GetRevision() uint64

func (*ResponseHeader) ProtoMessage

func (*ResponseHeader) ProtoMessage()

func (*ResponseHeader) ProtoReflect

func (x *ResponseHeader) ProtoReflect() protoreflect.Message

func (*ResponseHeader) Reset

func (x *ResponseHeader) Reset()

func (*ResponseHeader) String

func (x *ResponseHeader) String() string

type SetRequest

type SetRequest struct {

	// key is the key, in bytes, to set into the key-value store.
	Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	// value is the value, in bytes, to associate with the key in the key-value store.
	Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
	// ttl indicates the ttl time of this key-value store.
	// 0 means never ttl, the unit is second.
	Ttl         uint32 `protobuf:"varint,3,opt,name=ttl,proto3" json:"ttl,omitempty"`
	IgnoreValue bool   `protobuf:"varint,4,opt,name=ignore_value,json=ignoreValue,proto3" json:"ignore_value,omitempty"`
	IgnoreTtl   bool   `protobuf:"varint,5,opt,name=ignore_ttl,json=ignoreTtl,proto3" json:"ignore_ttl,omitempty"`
	// namespace means the same key-value store can exist in different namespaces
	Namespace *string `protobuf:"bytes,6,opt,name=namespace,proto3,oneof" json:"namespace,omitempty"`
	// contains filtered or unexported fields
}

--------------- KV store --------------- //

func (*SetRequest) Descriptor deprecated

func (*SetRequest) Descriptor() ([]byte, []int)

Deprecated: Use SetRequest.ProtoReflect.Descriptor instead.

func (*SetRequest) GetIgnoreTtl

func (x *SetRequest) GetIgnoreTtl() bool

func (*SetRequest) GetIgnoreValue

func (x *SetRequest) GetIgnoreValue() bool

func (*SetRequest) GetKey

func (x *SetRequest) GetKey() []byte

func (*SetRequest) GetNamespace

func (x *SetRequest) GetNamespace() string

func (*SetRequest) GetTtl

func (x *SetRequest) GetTtl() uint32

func (*SetRequest) GetValue

func (x *SetRequest) GetValue() []byte

func (*SetRequest) ProtoMessage

func (*SetRequest) ProtoMessage()

func (*SetRequest) ProtoReflect

func (x *SetRequest) ProtoReflect() protoreflect.Message

func (*SetRequest) Reset

func (x *SetRequest) Reset()

func (*SetRequest) String

func (x *SetRequest) String() string

type SetResponse

type SetResponse struct {
	Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"`
	// contains filtered or unexported fields
}

func (*SetResponse) Descriptor deprecated

func (*SetResponse) Descriptor() ([]byte, []int)

Deprecated: Use SetResponse.ProtoReflect.Descriptor instead.

func (*SetResponse) GetHeader

func (x *SetResponse) GetHeader() *ResponseHeader

func (*SetResponse) ProtoMessage

func (*SetResponse) ProtoMessage()

func (*SetResponse) ProtoReflect

func (x *SetResponse) ProtoReflect() protoreflect.Message

func (*SetResponse) Reset

func (x *SetResponse) Reset()

func (*SetResponse) String

func (x *SetResponse) String() string

type TryLockRequest

type TryLockRequest struct {
	LockId string `protobuf:"bytes,1,opt,name=lock_id,json=lockId,proto3" json:"lock_id,omitempty"`
	// ttl indicates the ttl time of this key-value store.
	// -1 means never ttl, the unit is second.
	Ttl int32 `protobuf:"varint,2,opt,name=ttl,proto3" json:"ttl,omitempty"`
	// deadline to TryLock
	Deadline int64 `protobuf:"varint,3,opt,name=deadline,proto3" json:"deadline,omitempty"`
	// contains filtered or unexported fields
}

func (*TryLockRequest) Descriptor deprecated

func (*TryLockRequest) Descriptor() ([]byte, []int)

Deprecated: Use TryLockRequest.ProtoReflect.Descriptor instead.

func (*TryLockRequest) GetDeadline

func (x *TryLockRequest) GetDeadline() int64

func (*TryLockRequest) GetLockId

func (x *TryLockRequest) GetLockId() string

func (*TryLockRequest) GetTtl

func (x *TryLockRequest) GetTtl() int32

func (*TryLockRequest) ProtoMessage

func (*TryLockRequest) ProtoMessage()

func (*TryLockRequest) ProtoReflect

func (x *TryLockRequest) ProtoReflect() protoreflect.Message

func (*TryLockRequest) Reset

func (x *TryLockRequest) Reset()

func (*TryLockRequest) String

func (x *TryLockRequest) String() string

type TryLockResponse

type TryLockResponse struct {
	Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"`
	// contains filtered or unexported fields
}

func (*TryLockResponse) Descriptor deprecated

func (*TryLockResponse) Descriptor() ([]byte, []int)

Deprecated: Use TryLockResponse.ProtoReflect.Descriptor instead.

func (*TryLockResponse) GetHeader

func (x *TryLockResponse) GetHeader() *ResponseHeader

func (*TryLockResponse) ProtoMessage

func (*TryLockResponse) ProtoMessage()

func (*TryLockResponse) ProtoReflect

func (x *TryLockResponse) ProtoReflect() protoreflect.Message

func (*TryLockResponse) Reset

func (x *TryLockResponse) Reset()

func (*TryLockResponse) String

func (x *TryLockResponse) String() string

type UnimplementedKVServer

type UnimplementedKVServer struct {
}

UnimplementedKVServer must be embedded to have forward compatible implementations.

func (UnimplementedKVServer) Delete

func (UnimplementedKVServer) Get

func (UnimplementedKVServer) PrefixScan

func (UnimplementedKVServer) Set

func (UnimplementedKVServer) TrySet

func (UnimplementedKVServer) Watch

func (UnimplementedKVServer) WatchPrefix added in v0.5.1

type UnimplementedLockerServer

type UnimplementedLockerServer struct {
}

UnimplementedLockerServer must be embedded to have forward compatible implementations.

func (UnimplementedLockerServer) Lock

func (UnimplementedLockerServer) TryLock

func (UnimplementedLockerServer) Unlock

type UnimplementedRedQueenServer

type UnimplementedRedQueenServer struct {
}

UnimplementedRedQueenServer must be embedded to have forward compatible implementations.

func (UnimplementedRedQueenServer) AppendCluster

func (UnimplementedRedQueenServer) LeaderMonitor

func (UnimplementedRedQueenServer) RaftSnapshot added in v0.7.0

func (UnimplementedRedQueenServer) RaftState

type UnlockRequest

type UnlockRequest struct {
	LockId string `protobuf:"bytes,1,opt,name=lock_id,json=lockId,proto3" json:"lock_id,omitempty"`
	// contains filtered or unexported fields
}

func (*UnlockRequest) Descriptor deprecated

func (*UnlockRequest) Descriptor() ([]byte, []int)

Deprecated: Use UnlockRequest.ProtoReflect.Descriptor instead.

func (*UnlockRequest) GetLockId

func (x *UnlockRequest) GetLockId() string

func (*UnlockRequest) ProtoMessage

func (*UnlockRequest) ProtoMessage()

func (*UnlockRequest) ProtoReflect

func (x *UnlockRequest) ProtoReflect() protoreflect.Message

func (*UnlockRequest) Reset

func (x *UnlockRequest) Reset()

func (*UnlockRequest) String

func (x *UnlockRequest) String() string

type UnlockResponse

type UnlockResponse struct {
	Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"`
	// contains filtered or unexported fields
}

func (*UnlockResponse) Descriptor deprecated

func (*UnlockResponse) Descriptor() ([]byte, []int)

Deprecated: Use UnlockResponse.ProtoReflect.Descriptor instead.

func (*UnlockResponse) GetHeader

func (x *UnlockResponse) GetHeader() *ResponseHeader

func (*UnlockResponse) ProtoMessage

func (*UnlockResponse) ProtoMessage()

func (*UnlockResponse) ProtoReflect

func (x *UnlockResponse) ProtoReflect() protoreflect.Message

func (*UnlockResponse) Reset

func (x *UnlockResponse) Reset()

func (*UnlockResponse) String

func (x *UnlockResponse) String() string

type UnsafeKVServer

type UnsafeKVServer interface {
	// contains filtered or unexported methods
}

UnsafeKVServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to KVServer will result in compilation errors.

type UnsafeLockerServer

type UnsafeLockerServer interface {
	// contains filtered or unexported methods
}

UnsafeLockerServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to LockerServer will result in compilation errors.

type UnsafeRedQueenServer

type UnsafeRedQueenServer interface {
	// contains filtered or unexported methods
}

UnsafeRedQueenServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to RedQueenServer will result in compilation errors.

type WatchPrefixRequest added in v0.5.1

type WatchPrefixRequest struct {

	// prefix is the prefix, keys prefix
	Prefix []byte `protobuf:"bytes,1,opt,name=prefix,proto3" json:"prefix,omitempty"`
	// namespace means the same key-value store can exist in different namespaces
	Namespace *string `protobuf:"bytes,3,opt,name=namespace,proto3,oneof" json:"namespace,omitempty"`
	// buf_size, declare the buffer size of watch
	BufSize *uint32 `protobuf:"varint,4,opt,name=buf_size,json=bufSize,proto3,oneof" json:"buf_size,omitempty"`
	// contains filtered or unexported fields
}

func (*WatchPrefixRequest) Descriptor deprecated added in v0.5.1

func (*WatchPrefixRequest) Descriptor() ([]byte, []int)

Deprecated: Use WatchPrefixRequest.ProtoReflect.Descriptor instead.

func (*WatchPrefixRequest) GetBufSize added in v0.5.1

func (x *WatchPrefixRequest) GetBufSize() uint32

func (*WatchPrefixRequest) GetNamespace added in v0.5.1

func (x *WatchPrefixRequest) GetNamespace() string

func (*WatchPrefixRequest) GetPrefix added in v0.5.1

func (x *WatchPrefixRequest) GetPrefix() []byte

func (*WatchPrefixRequest) ProtoMessage added in v0.5.1

func (*WatchPrefixRequest) ProtoMessage()

func (*WatchPrefixRequest) ProtoReflect added in v0.5.1

func (x *WatchPrefixRequest) ProtoReflect() protoreflect.Message

func (*WatchPrefixRequest) Reset added in v0.5.1

func (x *WatchPrefixRequest) Reset()

func (*WatchPrefixRequest) String added in v0.5.1

func (x *WatchPrefixRequest) String() string

type WatchRequest

type WatchRequest struct {

	// key is the key, in bytes, to delete into the key-value store.
	Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	// ignore_errors caused by problems such as key-value being deleted or not existing
	IgnoreErrors bool `protobuf:"varint,2,opt,name=ignore_errors,json=ignoreErrors,proto3" json:"ignore_errors,omitempty"`
	// namespace means the same key-value store can exist in different namespaces
	Namespace *string `protobuf:"bytes,3,opt,name=namespace,proto3,oneof" json:"namespace,omitempty"`
	// buf_size, declare the buffer size of watch
	BufSize *uint32 `protobuf:"varint,4,opt,name=buf_size,json=bufSize,proto3,oneof" json:"buf_size,omitempty"`
	// contains filtered or unexported fields
}

func (*WatchRequest) Descriptor deprecated

func (*WatchRequest) Descriptor() ([]byte, []int)

Deprecated: Use WatchRequest.ProtoReflect.Descriptor instead.

func (*WatchRequest) GetBufSize

func (x *WatchRequest) GetBufSize() uint32

func (*WatchRequest) GetIgnoreErrors

func (x *WatchRequest) GetIgnoreErrors() bool

func (*WatchRequest) GetKey

func (x *WatchRequest) GetKey() []byte

func (*WatchRequest) GetNamespace

func (x *WatchRequest) GetNamespace() string

func (*WatchRequest) ProtoMessage

func (*WatchRequest) ProtoMessage()

func (*WatchRequest) ProtoReflect

func (x *WatchRequest) ProtoReflect() protoreflect.Message

func (*WatchRequest) Reset

func (x *WatchRequest) Reset()

func (*WatchRequest) String

func (x *WatchRequest) String() string

type WatchResponse

type WatchResponse struct {
	Header *ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"`
	// update_seq is the updated serial number (current session)
	UpdateSeq uint64 `protobuf:"varint,2,opt,name=update_seq,json=updateSeq,proto3" json:"update_seq,omitempty"`
	// timestamp is the when this value was updated
	Timestamp int64  `protobuf:"varint,3,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
	Ttl       uint32 `protobuf:"varint,4,opt,name=ttl,proto3" json:"ttl,omitempty"`
	Key       []byte `protobuf:"bytes,5,opt,name=key,proto3" json:"key,omitempty"`
	Value     []byte `protobuf:"bytes,6,opt,name=value,proto3" json:"value,omitempty"`
	// contains filtered or unexported fields
}

func (*WatchResponse) Descriptor deprecated

func (*WatchResponse) Descriptor() ([]byte, []int)

Deprecated: Use WatchResponse.ProtoReflect.Descriptor instead.

func (*WatchResponse) GetHeader

func (x *WatchResponse) GetHeader() *ResponseHeader

func (*WatchResponse) GetKey added in v0.5.1

func (x *WatchResponse) GetKey() []byte

func (*WatchResponse) GetTimestamp

func (x *WatchResponse) GetTimestamp() int64

func (*WatchResponse) GetTtl added in v0.5.0

func (x *WatchResponse) GetTtl() uint32

func (*WatchResponse) GetUpdateSeq

func (x *WatchResponse) GetUpdateSeq() uint64

func (*WatchResponse) GetValue added in v0.5.1

func (x *WatchResponse) GetValue() []byte

func (*WatchResponse) ProtoMessage

func (*WatchResponse) ProtoMessage()

func (*WatchResponse) ProtoReflect

func (x *WatchResponse) ProtoReflect() protoreflect.Message

func (*WatchResponse) Reset

func (x *WatchResponse) Reset()

func (*WatchResponse) String

func (x *WatchResponse) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL