pb

package
v0.0.0-...-e82ecba Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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.

View Source
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) Descriptor deprecated

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

Deprecated: Use Command.ProtoReflect.Descriptor instead.

func (*Command) GetKv

func (x *Command) GetKv() *KV

func (*Command) GetType

func (x *Command) GetType() OperateType

func (*Command) ProtoMessage

func (*Command) ProtoMessage()

func (*Command) ProtoReflect

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

func (*Command) Reset

func (x *Command) Reset()

func (*Command) String

func (x *Command) String() string

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 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) Descriptor deprecated

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

Deprecated: Use Header.ProtoReflect.Descriptor instead.

func (*Header) GetLeaderAddress

func (x *Header) GetLeaderAddress() string

func (*Header) GetLeaderName

func (x *Header) GetLeaderName() string

func (*Header) GetMemberAddress

func (x *Header) GetMemberAddress() string

func (*Header) GetMemberName

func (x *Header) GetMemberName() string

func (*Header) GetRole

func (x *Header) GetRole() string

func (*Header) GetServers

func (x *Header) GetServers() map[string]string

func (*Header) GetSuccess

func (x *Header) GetSuccess() bool

func (*Header) GetTerm

func (x *Header) GetTerm() int32

func (*Header) ProtoMessage

func (*Header) ProtoMessage()

func (*Header) ProtoReflect

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

func (*Header) Reset

func (x *Header) Reset()

func (*Header) String

func (x *Header) String() string

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) Descriptor deprecated

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

Deprecated: Use KV.ProtoReflect.Descriptor instead.

func (*KV) GetCreateTime

func (x *KV) GetCreateTime() int64

func (*KV) GetKey

func (x *KV) GetKey() string

func (*KV) GetTtl

func (x *KV) GetTtl() int64

func (*KV) GetValue

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

func (*KV) ProtoMessage

func (*KV) ProtoMessage()

func (*KV) ProtoReflect

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

func (*KV) Reset

func (x *KV) Reset()

func (*KV) String

func (x *KV) String() string

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) 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

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

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) Get

func (*UnimplementedThemisServer) Put

func (*UnimplementedThemisServer) SearchByPrefix

func (*UnimplementedThemisServer) Watch

func (*UnimplementedThemisServer) WatchStream

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

Jump to

Keyboard shortcuts

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