gen

package
v0.11.7 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Op_name = map[int32]string{
		0:  "FIRST",
		1:  "SEEK",
		4:  "CURRENT",
		8:  "NEXT",
		15: "SEEK_EXACT",
		30: "OPEN",
		31: "CLOSE",
		64: "GET",
	}
	Op_value = map[string]int32{
		"FIRST":      0,
		"SEEK":       1,
		"CURRENT":    4,
		"NEXT":       8,
		"SEEK_EXACT": 15,
		"OPEN":       30,
		"CLOSE":      31,
		"GET":        64,
	}
)

Enum value maps for Op.

View Source
var KV_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "database.KV",
	HandlerType: (*KVServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Version",
			Handler:    _KV_Version_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "Tx",
			Handler:       _KV_Tx_Handler,
			ServerStreams: true,
			ClientStreams: true,
		},
	},
	Metadata: "kv.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)

Functions

func RegisterKVServer

func RegisterKVServer(s grpc.ServiceRegistrar, srv KVServer)

Types

type Cursor

type Cursor struct {
	Op         Op     `protobuf:"varint,1,opt,name=op,proto3,enum=database.Op" json:"op,omitempty"`
	BucketName []byte `protobuf:"bytes,2,opt,name=bucket_name,json=bucketName,proto3" json:"bucket_name,omitempty"`
	Cursor     uint32 `protobuf:"varint,3,opt,name=cursor,proto3" json:"cursor,omitempty"`
	K          []byte `protobuf:"bytes,4,opt,name=k,proto3" json:"k,omitempty"`
	V          []byte `protobuf:"bytes,5,opt,name=v,proto3" json:"v,omitempty"` // not used
	// contains filtered or unexported fields
}

func (*Cursor) Descriptor deprecated

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

Deprecated: Use Cursor.ProtoReflect.Descriptor instead.

func (*Cursor) GetBucketName

func (x *Cursor) GetBucketName() []byte

func (*Cursor) GetCursor

func (x *Cursor) GetCursor() uint32

func (*Cursor) GetK

func (x *Cursor) GetK() []byte

func (*Cursor) GetOp

func (x *Cursor) GetOp() Op

func (*Cursor) GetV

func (x *Cursor) GetV() []byte

func (*Cursor) ProtoMessage

func (*Cursor) ProtoMessage()

func (*Cursor) ProtoReflect

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

func (*Cursor) Reset

func (x *Cursor) Reset()

func (*Cursor) String

func (x *Cursor) String() string

type KVClient

type KVClient interface {
	Version(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*VersionReply, error)
	Tx(ctx context.Context, opts ...grpc.CallOption) (KV_TxClient, 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

type KVServer interface {
	Version(context.Context, *emptypb.Empty) (*VersionReply, error)
	Tx(KV_TxServer) error
	// contains filtered or unexported methods
}

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

type KV_TxClient

type KV_TxClient interface {
	Send(*Cursor) error
	Recv() (*Pair, error)
	grpc.ClientStream
}

type KV_TxServer

type KV_TxServer interface {
	Send(*Pair) error
	Recv() (*Cursor, error)
	grpc.ServerStream
}

type Op

type Op int32

values from https://github.com/ledgerwatch/interfaces/blob/master/remote/kv.proto#L68

const (
	Op_FIRST      Op = 0
	Op_SEEK       Op = 1
	Op_CURRENT    Op = 4
	Op_NEXT       Op = 8
	Op_SEEK_EXACT Op = 15
	Op_OPEN       Op = 30
	Op_CLOSE      Op = 31
	Op_GET        Op = 64
)

func (Op) Descriptor

func (Op) Descriptor() protoreflect.EnumDescriptor

func (Op) Enum

func (x Op) Enum() *Op

func (Op) EnumDescriptor deprecated

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

Deprecated: Use Op.Descriptor instead.

func (Op) Number

func (x Op) Number() protoreflect.EnumNumber

func (Op) String

func (x Op) String() string

func (Op) Type

func (Op) Type() protoreflect.EnumType

type Pair

type Pair struct {
	K        []byte `protobuf:"bytes,1,opt,name=k,proto3" json:"k,omitempty"`
	V        []byte `protobuf:"bytes,2,opt,name=v,proto3" json:"v,omitempty"`
	CursorId uint32 `protobuf:"varint,3,opt,name=cursor_id,json=cursorId,proto3" json:"cursor_id,omitempty"`
	ViewId   uint64 `protobuf:"varint,4,opt,name=view_id,json=viewId,proto3" json:"view_id,omitempty"` // not used
	TxId     uint64 `protobuf:"varint,5,opt,name=tx_id,json=txId,proto3" json:"tx_id,omitempty"`       // not used
	// contains filtered or unexported fields
}

func (*Pair) Descriptor deprecated

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

Deprecated: Use Pair.ProtoReflect.Descriptor instead.

func (*Pair) GetCursorId

func (x *Pair) GetCursorId() uint32

func (*Pair) GetK

func (x *Pair) GetK() []byte

func (*Pair) GetTxId

func (x *Pair) GetTxId() uint64

func (*Pair) GetV

func (x *Pair) GetV() []byte

func (*Pair) GetViewId

func (x *Pair) GetViewId() uint64

func (*Pair) ProtoMessage

func (*Pair) ProtoMessage()

func (*Pair) ProtoReflect

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

func (*Pair) Reset

func (x *Pair) Reset()

func (*Pair) String

func (x *Pair) String() string

type UnimplementedKVServer

type UnimplementedKVServer struct {
}

UnimplementedKVServer must be embedded to have forward compatible implementations.

func (UnimplementedKVServer) Tx

func (UnimplementedKVServer) Version

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 VersionReply

type VersionReply struct {
	Major uint32 `protobuf:"varint,1,opt,name=major,proto3" json:"major,omitempty"`
	Minor uint32 `protobuf:"varint,2,opt,name=minor,proto3" json:"minor,omitempty"`
	Patch uint32 `protobuf:"varint,3,opt,name=patch,proto3" json:"patch,omitempty"`
	// contains filtered or unexported fields
}

func (*VersionReply) Descriptor deprecated

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

Deprecated: Use VersionReply.ProtoReflect.Descriptor instead.

func (*VersionReply) GetMajor

func (x *VersionReply) GetMajor() uint32

func (*VersionReply) GetMinor

func (x *VersionReply) GetMinor() uint32

func (*VersionReply) GetPatch

func (x *VersionReply) GetPatch() uint32

func (*VersionReply) ProtoMessage

func (*VersionReply) ProtoMessage()

func (*VersionReply) ProtoReflect

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

func (*VersionReply) Reset

func (x *VersionReply) Reset()

func (*VersionReply) String

func (x *VersionReply) String() string

Jump to

Keyboard shortcuts

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