Documentation
¶
Index ¶
- Variables
- func RegisterThemisServer(s *grpc.Server, srv ThemisServer)
- type Command
- type DeleteRequest
- type DeleteResponse
- type GetRequest
- type GetResponse
- type Header
- func (*Header) Descriptor() ([]byte, []int)deprecated
- func (x *Header) GetLeaderAddress() string
- func (x *Header) GetLeaderName() string
- func (x *Header) GetMemberAddress() string
- func (x *Header) GetMemberName() string
- func (x *Header) GetRole() string
- func (x *Header) GetServers() map[string]string
- func (x *Header) GetSuccess() bool
- func (x *Header) GetTerm() int32
- func (*Header) ProtoMessage()
- func (x *Header) ProtoReflect() protoreflect.Message
- func (x *Header) Reset()
- func (x *Header) String() string
- type KV
- type OperateType
- func (OperateType) Descriptor() protoreflect.EnumDescriptor
- func (x OperateType) Enum() *OperateType
- func (OperateType) EnumDescriptor() ([]byte, []int)deprecated
- func (x OperateType) Number() protoreflect.EnumNumber
- func (x OperateType) String() string
- func (OperateType) Type() protoreflect.EnumType
- type PutRequest
- type PutResponse
- type SearchRequest
- type SearchResponse
- func (*SearchResponse) Descriptor() ([]byte, []int)deprecated
- func (x *SearchResponse) GetHeader() *Header
- func (x *SearchResponse) GetKvList() []*KV
- func (*SearchResponse) ProtoMessage()
- func (x *SearchResponse) ProtoReflect() protoreflect.Message
- func (x *SearchResponse) Reset()
- func (x *SearchResponse) String() string
- type ThemisClient
- type ThemisServer
- type Themis_WatchStreamClient
- type Themis_WatchStreamServer
- type UnimplementedThemisServer
- func (*UnimplementedThemisServer) Delete(context.Context, *DeleteRequest) (*DeleteResponse, error)
- func (*UnimplementedThemisServer) Get(context.Context, *GetRequest) (*GetResponse, error)
- func (*UnimplementedThemisServer) Put(context.Context, *PutRequest) (*PutResponse, error)
- func (*UnimplementedThemisServer) SearchByPrefix(context.Context, *SearchRequest) (*SearchResponse, error)
- func (*UnimplementedThemisServer) Watch(context.Context, *WatchRequest) (*WatchResponse, error)
- func (*UnimplementedThemisServer) WatchStream(*WatchRequest, Themis_WatchStreamServer) error
- type WatchRequest
- func (*WatchRequest) Descriptor() ([]byte, []int)deprecated
- func (x *WatchRequest) GetKey() string
- func (x *WatchRequest) GetType() OperateType
- func (*WatchRequest) ProtoMessage()
- func (x *WatchRequest) ProtoReflect() protoreflect.Message
- func (x *WatchRequest) Reset()
- func (x *WatchRequest) String() string
- type WatchResponse
- func (*WatchResponse) Descriptor() ([]byte, []int)deprecated
- func (x *WatchResponse) GetHeader() *Header
- func (x *WatchResponse) GetKv() *KV
- func (x *WatchResponse) GetPrevKv() *KV
- func (x *WatchResponse) GetType() OperateType
- func (*WatchResponse) ProtoMessage()
- func (x *WatchResponse) ProtoReflect() protoreflect.Message
- func (x *WatchResponse) Reset()
- func (x *WatchResponse) String() string
Constants ¶
This section is empty.
Variables ¶
var ( OperateType_name = map[int32]string{ 0: "All", 1: "Set", 2: "Get", 3: "Delete", 4: "Write", 5: "Expire", } OperateType_value = map[string]int32{ "All": 0, "Set": 1, "Get": 2, "Delete": 3, "Write": 4, "Expire": 5, } )
Enum value maps for OperateType.
var File_server_proto protoreflect.FileDescriptor
Functions ¶
func RegisterThemisServer ¶
func RegisterThemisServer(s *grpc.Server, srv ThemisServer)
Types ¶
type Command ¶
type Command struct { Kv *KV `protobuf:"bytes,1,opt,name=kv,proto3" json:"kv,omitempty"` Type OperateType `protobuf:"varint,2,opt,name=type,proto3,enum=pb.OperateType" json:"type,omitempty"` // contains filtered or unexported fields }
func (*Command) GetType ¶
func (x *Command) GetType() OperateType
func (*Command) ProtoReflect ¶
func (x *Command) ProtoReflect() protoreflect.Message
type DeleteRequest ¶
type DeleteRequest struct { Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,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() 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 *Header `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() *Header
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 string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,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() 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 *Header `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` Kv *KV `protobuf:"bytes,2,opt,name=kv,proto3" json:"kv,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() *Header
func (*GetResponse) GetKv ¶
func (x *GetResponse) GetKv() *KV
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 Header ¶
type Header struct { MemberName string `protobuf:"bytes,1,opt,name=member_name,json=memberName,proto3" json:"member_name,omitempty"` MemberAddress string `protobuf:"bytes,2,opt,name=member_address,json=memberAddress,proto3" json:"member_address,omitempty"` Role string `protobuf:"bytes,3,opt,name=role,proto3" json:"role,omitempty"` Term int32 `protobuf:"varint,4,opt,name=term,proto3" json:"term,omitempty"` LeaderName string `protobuf:"bytes,5,opt,name=leader_name,json=leaderName,proto3" json:"leader_name,omitempty"` LeaderAddress string `protobuf:"bytes,6,opt,name=leader_address,json=leaderAddress,proto3" json:"leader_address,omitempty"` Servers map[string]string `` /* 155-byte string literal not displayed */ // is success Success bool `protobuf:"varint,8,opt,name=success,proto3" json:"success,omitempty"` // contains filtered or unexported fields }
func (*Header) ProtoReflect ¶
func (x *Header) ProtoReflect() protoreflect.Message
type KV ¶
type KV struct { Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` CreateTime int64 `protobuf:"varint,3,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` Ttl int64 `protobuf:"varint,4,opt,name=ttl,proto3" json:"ttl,omitempty"` // contains filtered or unexported fields }
func (*KV) ProtoReflect ¶
func (x *KV) ProtoReflect() protoreflect.Message
type OperateType ¶
type OperateType int32
const ( OperateType_All OperateType = 0 OperateType_Set OperateType = 1 OperateType_Get OperateType = 2 OperateType_Delete OperateType = 3 OperateType_Write OperateType = 4 OperateType_Expire OperateType = 5 )
func (OperateType) Descriptor ¶
func (OperateType) Descriptor() protoreflect.EnumDescriptor
func (OperateType) Enum ¶
func (x OperateType) Enum() *OperateType
func (OperateType) EnumDescriptor
deprecated
func (OperateType) EnumDescriptor() ([]byte, []int)
Deprecated: Use OperateType.Descriptor instead.
func (OperateType) Number ¶
func (x OperateType) Number() protoreflect.EnumNumber
func (OperateType) String ¶
func (x OperateType) String() string
func (OperateType) Type ¶
func (OperateType) Type() protoreflect.EnumType
type PutRequest ¶
type PutRequest struct { Kv *KV `protobuf:"bytes,1,opt,name=kv,proto3" json:"kv,omitempty"` // contains filtered or unexported fields }
func (*PutRequest) Descriptor
deprecated
func (*PutRequest) Descriptor() ([]byte, []int)
Deprecated: Use PutRequest.ProtoReflect.Descriptor instead.
func (*PutRequest) GetKv ¶
func (x *PutRequest) GetKv() *KV
func (*PutRequest) ProtoMessage ¶
func (*PutRequest) ProtoMessage()
func (*PutRequest) ProtoReflect ¶
func (x *PutRequest) ProtoReflect() protoreflect.Message
func (*PutRequest) Reset ¶
func (x *PutRequest) Reset()
func (*PutRequest) String ¶
func (x *PutRequest) String() string
type PutResponse ¶
type PutResponse struct { Header *Header `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` // contains filtered or unexported fields }
func (*PutResponse) Descriptor
deprecated
func (*PutResponse) Descriptor() ([]byte, []int)
Deprecated: Use PutResponse.ProtoReflect.Descriptor instead.
func (*PutResponse) GetHeader ¶
func (x *PutResponse) GetHeader() *Header
func (*PutResponse) ProtoMessage ¶
func (*PutResponse) ProtoMessage()
func (*PutResponse) ProtoReflect ¶
func (x *PutResponse) ProtoReflect() protoreflect.Message
func (*PutResponse) Reset ¶
func (x *PutResponse) Reset()
func (*PutResponse) String ¶
func (x *PutResponse) String() string
type SearchRequest ¶
type SearchRequest struct { PrefixKey string `protobuf:"bytes,1,opt,name=prefix_key,json=prefixKey,proto3" json:"prefix_key,omitempty"` // contains filtered or unexported fields }
func (*SearchRequest) Descriptor
deprecated
func (*SearchRequest) Descriptor() ([]byte, []int)
Deprecated: Use SearchRequest.ProtoReflect.Descriptor instead.
func (*SearchRequest) GetPrefixKey ¶
func (x *SearchRequest) GetPrefixKey() string
func (*SearchRequest) ProtoMessage ¶
func (*SearchRequest) ProtoMessage()
func (*SearchRequest) ProtoReflect ¶
func (x *SearchRequest) ProtoReflect() protoreflect.Message
func (*SearchRequest) Reset ¶
func (x *SearchRequest) Reset()
func (*SearchRequest) String ¶
func (x *SearchRequest) String() string
type SearchResponse ¶
type SearchResponse struct { Header *Header `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` KvList []*KV `protobuf:"bytes,2,rep,name=kv_list,json=kvList,proto3" json:"kv_list,omitempty"` // contains filtered or unexported fields }
func (*SearchResponse) Descriptor
deprecated
func (*SearchResponse) Descriptor() ([]byte, []int)
Deprecated: Use SearchResponse.ProtoReflect.Descriptor instead.
func (*SearchResponse) GetHeader ¶
func (x *SearchResponse) GetHeader() *Header
func (*SearchResponse) GetKvList ¶
func (x *SearchResponse) GetKvList() []*KV
func (*SearchResponse) ProtoMessage ¶
func (*SearchResponse) ProtoMessage()
func (*SearchResponse) ProtoReflect ¶
func (x *SearchResponse) ProtoReflect() protoreflect.Message
func (*SearchResponse) Reset ¶
func (x *SearchResponse) Reset()
func (*SearchResponse) String ¶
func (x *SearchResponse) String() string
type ThemisClient ¶
type ThemisClient interface { Put(ctx context.Context, in *PutRequest, opts ...grpc.CallOption) (*PutResponse, error) Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetResponse, error) Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*DeleteResponse, error) SearchByPrefix(ctx context.Context, in *SearchRequest, opts ...grpc.CallOption) (*SearchResponse, error) WatchStream(ctx context.Context, in *WatchRequest, opts ...grpc.CallOption) (Themis_WatchStreamClient, error) Watch(ctx context.Context, in *WatchRequest, opts ...grpc.CallOption) (*WatchResponse, error) }
ThemisClient is the client API for Themis service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewThemisClient ¶
func NewThemisClient(cc grpc.ClientConnInterface) ThemisClient
type ThemisServer ¶
type ThemisServer interface { Put(context.Context, *PutRequest) (*PutResponse, error) Get(context.Context, *GetRequest) (*GetResponse, error) Delete(context.Context, *DeleteRequest) (*DeleteResponse, error) SearchByPrefix(context.Context, *SearchRequest) (*SearchResponse, error) WatchStream(*WatchRequest, Themis_WatchStreamServer) error Watch(context.Context, *WatchRequest) (*WatchResponse, error) }
ThemisServer is the server API for Themis service.
type Themis_WatchStreamClient ¶
type Themis_WatchStreamClient interface { Recv() (*WatchResponse, error) grpc.ClientStream }
type Themis_WatchStreamServer ¶
type Themis_WatchStreamServer interface { Send(*WatchResponse) error grpc.ServerStream }
type UnimplementedThemisServer ¶
type UnimplementedThemisServer struct { }
UnimplementedThemisServer can be embedded to have forward compatible implementations.
func (*UnimplementedThemisServer) Delete ¶
func (*UnimplementedThemisServer) Delete(context.Context, *DeleteRequest) (*DeleteResponse, error)
func (*UnimplementedThemisServer) Get ¶
func (*UnimplementedThemisServer) Get(context.Context, *GetRequest) (*GetResponse, error)
func (*UnimplementedThemisServer) Put ¶
func (*UnimplementedThemisServer) Put(context.Context, *PutRequest) (*PutResponse, error)
func (*UnimplementedThemisServer) SearchByPrefix ¶
func (*UnimplementedThemisServer) SearchByPrefix(context.Context, *SearchRequest) (*SearchResponse, error)
func (*UnimplementedThemisServer) Watch ¶
func (*UnimplementedThemisServer) Watch(context.Context, *WatchRequest) (*WatchResponse, error)
func (*UnimplementedThemisServer) WatchStream ¶
func (*UnimplementedThemisServer) WatchStream(*WatchRequest, Themis_WatchStreamServer) error
type WatchRequest ¶
type WatchRequest struct { Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` Type OperateType `protobuf:"varint,2,opt,name=type,proto3,enum=pb.OperateType" json:"type,omitempty"` // contains filtered or unexported fields }
func (*WatchRequest) Descriptor
deprecated
func (*WatchRequest) Descriptor() ([]byte, []int)
Deprecated: Use WatchRequest.ProtoReflect.Descriptor instead.
func (*WatchRequest) GetKey ¶
func (x *WatchRequest) GetKey() string
func (*WatchRequest) GetType ¶
func (x *WatchRequest) GetType() OperateType
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 *Header `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` PrevKv *KV `protobuf:"bytes,2,opt,name=prev_kv,json=prevKv,proto3" json:"prev_kv,omitempty"` Kv *KV `protobuf:"bytes,3,opt,name=kv,proto3" json:"kv,omitempty"` Type OperateType `protobuf:"varint,4,opt,name=type,proto3,enum=pb.OperateType" json:"type,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() *Header
func (*WatchResponse) GetKv ¶
func (x *WatchResponse) GetKv() *KV
func (*WatchResponse) GetPrevKv ¶
func (x *WatchResponse) GetPrevKv() *KV
func (*WatchResponse) GetType ¶
func (x *WatchResponse) GetType() OperateType
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