txnpb

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2021 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TxnState_name = map[int32]string{
		0: "StateInvalid",
		1: "StateUncommitted",
		2: "StateStaging",
		3: "StateCommitted",
		4: "StateRollbacking",
		5: "StateRollbacked",
	}
	TxnState_value = map[string]int32{
		"StateInvalid":     0,
		"StateUncommitted": 1,
		"StateStaging":     2,
		"StateCommitted":   3,
		"StateRollbacking": 4,
		"StateRollbacked":  5,
	}
)

Enum value maps for TxnState.

Functions

func RegisterTxnServiceServer

func RegisterTxnServiceServer(s *grpc.Server, srv TxnServiceServer)

Types

type BeginRequest

type BeginRequest struct {
	Opt *TxnOption `protobuf:"bytes,1,opt,name=opt,proto3" json:"opt,omitempty"`
	// contains filtered or unexported fields
}

func (*BeginRequest) Descriptor deprecated

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

Deprecated: Use BeginRequest.ProtoReflect.Descriptor instead.

func (*BeginRequest) GetOpt

func (x *BeginRequest) GetOpt() *TxnOption

func (*BeginRequest) ProtoMessage

func (*BeginRequest) ProtoMessage()

func (*BeginRequest) ProtoReflect

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

func (*BeginRequest) Reset

func (x *BeginRequest) Reset()

func (*BeginRequest) String

func (x *BeginRequest) String() string

type BeginResponse

type BeginResponse struct {
	Err *commonpb.Error `protobuf:"bytes,1,opt,name=err,proto3" json:"err,omitempty"`
	Txn *Txn            `protobuf:"bytes,2,opt,name=txn,proto3" json:"txn,omitempty"`
	// contains filtered or unexported fields
}

func (*BeginResponse) Descriptor deprecated

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

Deprecated: Use BeginResponse.ProtoReflect.Descriptor instead.

func (*BeginResponse) GetErr

func (x *BeginResponse) GetErr() *commonpb.Error

func (*BeginResponse) GetTxn

func (x *BeginResponse) GetTxn() *Txn

func (*BeginResponse) ProtoMessage

func (*BeginResponse) ProtoMessage()

func (*BeginResponse) ProtoReflect

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

func (*BeginResponse) Reset

func (x *BeginResponse) Reset()

func (*BeginResponse) String

func (x *BeginResponse) String() string

type CommitRequest

type CommitRequest struct {
	TxnId uint64 `protobuf:"varint,1,opt,name=txn_id,json=txnId,proto3" json:"txn_id,omitempty"`
	// contains filtered or unexported fields
}

func (*CommitRequest) Descriptor deprecated

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

Deprecated: Use CommitRequest.ProtoReflect.Descriptor instead.

func (*CommitRequest) GetTxnId

func (x *CommitRequest) GetTxnId() uint64

func (*CommitRequest) ProtoMessage

func (*CommitRequest) ProtoMessage()

func (*CommitRequest) ProtoReflect

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

func (*CommitRequest) Reset

func (x *CommitRequest) Reset()

func (*CommitRequest) String

func (x *CommitRequest) String() string

type CommitResponse

type CommitResponse struct {
	Err *commonpb.Error `protobuf:"bytes,1,opt,name=err,proto3" json:"err,omitempty"`
	Txn *Txn            `protobuf:"bytes,2,opt,name=txn,proto3" json:"txn,omitempty"`
	// contains filtered or unexported fields
}

func (*CommitResponse) Descriptor deprecated

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

Deprecated: Use CommitResponse.ProtoReflect.Descriptor instead.

func (*CommitResponse) GetErr

func (x *CommitResponse) GetErr() *commonpb.Error

func (*CommitResponse) GetTxn

func (x *CommitResponse) GetTxn() *Txn

func (*CommitResponse) ProtoMessage

func (*CommitResponse) ProtoMessage()

func (*CommitResponse) ProtoReflect

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

func (*CommitResponse) Reset

func (x *CommitResponse) Reset()

func (*CommitResponse) String

func (x *CommitResponse) String() string

type RollbackRequest

type RollbackRequest struct {
	TxnId uint64 `protobuf:"varint,1,opt,name=txn_id,json=txnId,proto3" json:"txn_id,omitempty"`
	// contains filtered or unexported fields
}

func (*RollbackRequest) Descriptor deprecated

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

Deprecated: Use RollbackRequest.ProtoReflect.Descriptor instead.

func (*RollbackRequest) GetTxnId

func (x *RollbackRequest) GetTxnId() uint64

func (*RollbackRequest) ProtoMessage

func (*RollbackRequest) ProtoMessage()

func (*RollbackRequest) ProtoReflect

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

func (*RollbackRequest) Reset

func (x *RollbackRequest) Reset()

func (*RollbackRequest) String

func (x *RollbackRequest) String() string

type RollbackResponse

type RollbackResponse struct {
	Err *commonpb.Error `protobuf:"bytes,1,opt,name=err,proto3" json:"err,omitempty"`
	Txn *Txn            `protobuf:"bytes,2,opt,name=txn,proto3" json:"txn,omitempty"`
	// contains filtered or unexported fields
}

func (*RollbackResponse) Descriptor deprecated

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

Deprecated: Use RollbackResponse.ProtoReflect.Descriptor instead.

func (*RollbackResponse) GetErr

func (x *RollbackResponse) GetErr() *commonpb.Error

func (*RollbackResponse) GetTxn

func (x *RollbackResponse) GetTxn() *Txn

func (*RollbackResponse) ProtoMessage

func (*RollbackResponse) ProtoMessage()

func (*RollbackResponse) ProtoReflect

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

func (*RollbackResponse) Reset

func (x *RollbackResponse) Reset()

func (*RollbackResponse) String

func (x *RollbackResponse) String() string

type TValue

type TValue struct {
	Value           *commonpb.Value `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"`
	SnapshotVersion uint64          `protobuf:"varint,2,opt,name=snapshot_version,json=snapshotVersion,proto3" json:"snapshot_version,omitempty"`
	// contains filtered or unexported fields
}

func (*TValue) Descriptor deprecated

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

Deprecated: Use TValue.ProtoReflect.Descriptor instead.

func (*TValue) GetSnapshotVersion

func (x *TValue) GetSnapshotVersion() uint64

func (*TValue) GetValue

func (x *TValue) GetValue() *commonpb.Value

func (*TValue) ProtoMessage

func (*TValue) ProtoMessage()

func (*TValue) ProtoReflect

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

func (*TValue) Reset

func (x *TValue) Reset()

func (*TValue) String

func (x *TValue) String() string

func (*TValue) Validate

func (x *TValue) Validate() error

type TValues

type TValues []*TValue

func (TValues) Validate

func (x TValues) Validate(expectedLen int) error

type Txn

type Txn struct {
	Id                 uint64                 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	Type               uint32                 `protobuf:"varint,2,opt,name=type,proto3" json:"type,omitempty"`
	State              TxnState               `protobuf:"varint,3,opt,name=state,proto3,enum=proto.TxnState" json:"state,omitempty"`
	SnapshotReadOption *TxnSnapshotReadOption `protobuf:"bytes,4,opt,name=snapshot_read_option,json=snapshotReadOption,proto3" json:"snapshot_read_option,omitempty"`
	// contains filtered or unexported fields
}

func (*Txn) Descriptor deprecated

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

Deprecated: Use Txn.ProtoReflect.Descriptor instead.

func (*Txn) GetId

func (x *Txn) GetId() uint64

func (*Txn) GetSnapshotReadOption

func (x *Txn) GetSnapshotReadOption() *TxnSnapshotReadOption

func (*Txn) GetState

func (x *Txn) GetState() TxnState

func (*Txn) GetType

func (x *Txn) GetType() uint32

func (*Txn) ProtoMessage

func (*Txn) ProtoMessage()

func (*Txn) ProtoReflect

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

func (*Txn) Reset

func (x *Txn) Reset()

func (*Txn) String

func (x *Txn) String() string

type TxnGetRequest

type TxnGetRequest struct {
	Key   string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	TxnId uint64 `protobuf:"varint,2,opt,name=txn_id,json=txnId,proto3" json:"txn_id,omitempty"`
	// contains filtered or unexported fields
}

func (*TxnGetRequest) Descriptor deprecated

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

Deprecated: Use TxnGetRequest.ProtoReflect.Descriptor instead.

func (*TxnGetRequest) GetKey

func (x *TxnGetRequest) GetKey() string

func (*TxnGetRequest) GetTxnId

func (x *TxnGetRequest) GetTxnId() uint64

func (*TxnGetRequest) ProtoMessage

func (*TxnGetRequest) ProtoMessage()

func (*TxnGetRequest) ProtoReflect

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

func (*TxnGetRequest) Reset

func (x *TxnGetRequest) Reset()

func (*TxnGetRequest) String

func (x *TxnGetRequest) String() string

type TxnGetResponse

type TxnGetResponse struct {
	Err    *commonpb.Error `protobuf:"bytes,1,opt,name=err,proto3" json:"err,omitempty"`
	TValue *TValue         `protobuf:"bytes,2,opt,name=t_value,json=tValue,proto3" json:"t_value,omitempty"`
	Txn    *Txn            `protobuf:"bytes,3,opt,name=txn,proto3" json:"txn,omitempty"`
	// contains filtered or unexported fields
}

func (*TxnGetResponse) Descriptor deprecated

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

Deprecated: Use TxnGetResponse.ProtoReflect.Descriptor instead.

func (*TxnGetResponse) GetErr

func (x *TxnGetResponse) GetErr() *commonpb.Error

func (*TxnGetResponse) GetTValue

func (x *TxnGetResponse) GetTValue() *TValue

func (*TxnGetResponse) GetTxn

func (x *TxnGetResponse) GetTxn() *Txn

func (*TxnGetResponse) ProtoMessage

func (*TxnGetResponse) ProtoMessage()

func (*TxnGetResponse) ProtoReflect

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

func (*TxnGetResponse) Reset

func (x *TxnGetResponse) Reset()

func (*TxnGetResponse) String

func (x *TxnGetResponse) String() string

type TxnMGetRequest

type TxnMGetRequest struct {
	Keys  []string `protobuf:"bytes,1,rep,name=keys,proto3" json:"keys,omitempty"`
	TxnId uint64   `protobuf:"varint,2,opt,name=txn_id,json=txnId,proto3" json:"txn_id,omitempty"`
	// contains filtered or unexported fields
}

func (*TxnMGetRequest) Descriptor deprecated

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

Deprecated: Use TxnMGetRequest.ProtoReflect.Descriptor instead.

func (*TxnMGetRequest) GetKeys

func (x *TxnMGetRequest) GetKeys() []string

func (*TxnMGetRequest) GetTxnId

func (x *TxnMGetRequest) GetTxnId() uint64

func (*TxnMGetRequest) ProtoMessage

func (*TxnMGetRequest) ProtoMessage()

func (*TxnMGetRequest) ProtoReflect

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

func (*TxnMGetRequest) Reset

func (x *TxnMGetRequest) Reset()

func (*TxnMGetRequest) String

func (x *TxnMGetRequest) String() string

type TxnMGetResponse

type TxnMGetResponse struct {
	Err     *commonpb.Error `protobuf:"bytes,1,opt,name=err,proto3" json:"err,omitempty"`
	TValues []*TValue       `protobuf:"bytes,2,rep,name=t_values,json=tValues,proto3" json:"t_values,omitempty"`
	Txn     *Txn            `protobuf:"bytes,3,opt,name=txn,proto3" json:"txn,omitempty"`
	// contains filtered or unexported fields
}

func (*TxnMGetResponse) Descriptor deprecated

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

Deprecated: Use TxnMGetResponse.ProtoReflect.Descriptor instead.

func (*TxnMGetResponse) GetErr

func (x *TxnMGetResponse) GetErr() *commonpb.Error

func (*TxnMGetResponse) GetTValues

func (x *TxnMGetResponse) GetTValues() []*TValue

func (*TxnMGetResponse) GetTxn

func (x *TxnMGetResponse) GetTxn() *Txn

func (*TxnMGetResponse) ProtoMessage

func (*TxnMGetResponse) ProtoMessage()

func (*TxnMGetResponse) ProtoReflect

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

func (*TxnMGetResponse) Reset

func (x *TxnMGetResponse) Reset()

func (*TxnMGetResponse) String

func (x *TxnMGetResponse) String() string

type TxnMSetRequest

type TxnMSetRequest struct {
	Keys   []string `protobuf:"bytes,1,rep,name=keys,proto3" json:"keys,omitempty"`
	Values [][]byte `protobuf:"bytes,2,rep,name=values,proto3" json:"values,omitempty"`
	TxnId  uint64   `protobuf:"varint,3,opt,name=txn_id,json=txnId,proto3" json:"txn_id,omitempty"`
	// contains filtered or unexported fields
}

func (*TxnMSetRequest) Descriptor deprecated

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

Deprecated: Use TxnMSetRequest.ProtoReflect.Descriptor instead.

func (*TxnMSetRequest) GetKeys

func (x *TxnMSetRequest) GetKeys() []string

func (*TxnMSetRequest) GetTxnId

func (x *TxnMSetRequest) GetTxnId() uint64

func (*TxnMSetRequest) GetValues

func (x *TxnMSetRequest) GetValues() [][]byte

func (*TxnMSetRequest) ProtoMessage

func (*TxnMSetRequest) ProtoMessage()

func (*TxnMSetRequest) ProtoReflect

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

func (*TxnMSetRequest) Reset

func (x *TxnMSetRequest) Reset()

func (*TxnMSetRequest) String

func (x *TxnMSetRequest) String() string

type TxnMSetResponse

type TxnMSetResponse struct {
	Err *commonpb.Error `protobuf:"bytes,1,opt,name=err,proto3" json:"err,omitempty"`
	Txn *Txn            `protobuf:"bytes,2,opt,name=txn,proto3" json:"txn,omitempty"`
	// contains filtered or unexported fields
}

func (*TxnMSetResponse) Descriptor deprecated

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

Deprecated: Use TxnMSetResponse.ProtoReflect.Descriptor instead.

func (*TxnMSetResponse) GetErr

func (x *TxnMSetResponse) GetErr() *commonpb.Error

func (*TxnMSetResponse) GetTxn

func (x *TxnMSetResponse) GetTxn() *Txn

func (*TxnMSetResponse) ProtoMessage

func (*TxnMSetResponse) ProtoMessage()

func (*TxnMSetResponse) ProtoReflect

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

func (*TxnMSetResponse) Reset

func (x *TxnMSetResponse) Reset()

func (*TxnMSetResponse) String

func (x *TxnMSetResponse) String() string

type TxnOption

type TxnOption struct {
	Type               uint32                 `protobuf:"varint,1,opt,name=type,proto3" json:"type,omitempty"`
	SnapshotReadOption *TxnSnapshotReadOption `protobuf:"bytes,2,opt,name=snapshot_read_option,json=snapshotReadOption,proto3" json:"snapshot_read_option,omitempty"`
	// contains filtered or unexported fields
}

func (*TxnOption) Descriptor deprecated

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

Deprecated: Use TxnOption.ProtoReflect.Descriptor instead.

func (*TxnOption) GetSnapshotReadOption

func (x *TxnOption) GetSnapshotReadOption() *TxnSnapshotReadOption

func (*TxnOption) GetTxnType

func (x *TxnOption) GetTxnType() uint8

func (*TxnOption) GetType

func (x *TxnOption) GetType() uint32

func (*TxnOption) ProtoMessage

func (*TxnOption) ProtoMessage()

func (*TxnOption) ProtoReflect

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

func (*TxnOption) Reset

func (x *TxnOption) Reset()

func (*TxnOption) String

func (x *TxnOption) String() string

type TxnServiceClient

type TxnServiceClient interface {
	Begin(ctx context.Context, in *BeginRequest, opts ...grpc.CallOption) (*BeginResponse, error)
	Get(ctx context.Context, in *TxnGetRequest, opts ...grpc.CallOption) (*TxnGetResponse, error)
	MGet(ctx context.Context, in *TxnMGetRequest, opts ...grpc.CallOption) (*TxnMGetResponse, error)
	Set(ctx context.Context, in *TxnSetRequest, opts ...grpc.CallOption) (*TxnSetResponse, error)
	MSet(ctx context.Context, in *TxnMSetRequest, opts ...grpc.CallOption) (*TxnMSetResponse, error)
	Rollback(ctx context.Context, in *RollbackRequest, opts ...grpc.CallOption) (*RollbackResponse, error)
	Commit(ctx context.Context, in *CommitRequest, opts ...grpc.CallOption) (*CommitResponse, error)
}

TxnServiceClient is the client API for TxnService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewTxnServiceClient

func NewTxnServiceClient(cc grpc.ClientConnInterface) TxnServiceClient

type TxnSetRequest

type TxnSetRequest 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"`
	TxnId uint64 `protobuf:"varint,3,opt,name=txn_id,json=txnId,proto3" json:"txn_id,omitempty"`
	// contains filtered or unexported fields
}

func (*TxnSetRequest) Descriptor deprecated

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

Deprecated: Use TxnSetRequest.ProtoReflect.Descriptor instead.

func (*TxnSetRequest) GetKey

func (x *TxnSetRequest) GetKey() string

func (*TxnSetRequest) GetTxnId

func (x *TxnSetRequest) GetTxnId() uint64

func (*TxnSetRequest) GetValue

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

func (*TxnSetRequest) ProtoMessage

func (*TxnSetRequest) ProtoMessage()

func (*TxnSetRequest) ProtoReflect

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

func (*TxnSetRequest) Reset

func (x *TxnSetRequest) Reset()

func (*TxnSetRequest) String

func (x *TxnSetRequest) String() string

type TxnSetResponse

type TxnSetResponse struct {
	Err *commonpb.Error `protobuf:"bytes,1,opt,name=err,proto3" json:"err,omitempty"`
	Txn *Txn            `protobuf:"bytes,2,opt,name=txn,proto3" json:"txn,omitempty"`
	// contains filtered or unexported fields
}

func (*TxnSetResponse) Descriptor deprecated

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

Deprecated: Use TxnSetResponse.ProtoReflect.Descriptor instead.

func (*TxnSetResponse) GetErr

func (x *TxnSetResponse) GetErr() *commonpb.Error

func (*TxnSetResponse) GetTxn

func (x *TxnSetResponse) GetTxn() *Txn

func (*TxnSetResponse) ProtoMessage

func (*TxnSetResponse) ProtoMessage()

func (*TxnSetResponse) ProtoReflect

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

func (*TxnSetResponse) Reset

func (x *TxnSetResponse) Reset()

func (*TxnSetResponse) String

func (x *TxnSetResponse) String() string

type TxnSnapshotReadOption

type TxnSnapshotReadOption struct {
	SnapshotVersion           uint64 `protobuf:"varint,1,opt,name=snapshot_version,json=snapshotVersion,proto3" json:"snapshot_version,omitempty"`
	MinAllowedSnapshotVersion uint64 `` /* 141-byte string literal not displayed */
	Flag                      uint32 `protobuf:"varint,3,opt,name=flag,proto3" json:"flag,omitempty"`
	// contains filtered or unexported fields
}

func (*TxnSnapshotReadOption) Descriptor deprecated

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

Deprecated: Use TxnSnapshotReadOption.ProtoReflect.Descriptor instead.

func (*TxnSnapshotReadOption) GetFlag

func (x *TxnSnapshotReadOption) GetFlag() uint32

func (*TxnSnapshotReadOption) GetFlagAsUint8

func (x *TxnSnapshotReadOption) GetFlagAsUint8() uint8

func (*TxnSnapshotReadOption) GetMinAllowedSnapshotVersion

func (x *TxnSnapshotReadOption) GetMinAllowedSnapshotVersion() uint64

func (*TxnSnapshotReadOption) GetSnapshotVersion

func (x *TxnSnapshotReadOption) GetSnapshotVersion() uint64

func (*TxnSnapshotReadOption) ProtoMessage

func (*TxnSnapshotReadOption) ProtoMessage()

func (*TxnSnapshotReadOption) ProtoReflect

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

func (*TxnSnapshotReadOption) Reset

func (x *TxnSnapshotReadOption) Reset()

func (*TxnSnapshotReadOption) String

func (x *TxnSnapshotReadOption) String() string

type TxnState

type TxnState int32
const (
	TxnState_StateInvalid     TxnState = 0
	TxnState_StateUncommitted TxnState = 1
	TxnState_StateStaging     TxnState = 2
	TxnState_StateCommitted   TxnState = 3
	TxnState_StateRollbacking TxnState = 4
	TxnState_StateRollbacked  TxnState = 5
)

func (TxnState) Descriptor

func (TxnState) Descriptor() protoreflect.EnumDescriptor

func (TxnState) Enum

func (x TxnState) Enum() *TxnState

func (TxnState) EnumDescriptor deprecated

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

Deprecated: Use TxnState.Descriptor instead.

func (TxnState) Number

func (x TxnState) Number() protoreflect.EnumNumber

func (TxnState) String

func (x TxnState) String() string

func (TxnState) Type

type UnimplementedTxnServiceServer

type UnimplementedTxnServiceServer struct {
}

UnimplementedTxnServiceServer can be embedded to have forward compatible implementations.

func (*UnimplementedTxnServiceServer) Begin

func (*UnimplementedTxnServiceServer) Commit

func (*UnimplementedTxnServiceServer) Get

func (*UnimplementedTxnServiceServer) MGet

func (*UnimplementedTxnServiceServer) MSet

func (*UnimplementedTxnServiceServer) Rollback

func (*UnimplementedTxnServiceServer) Set

Jump to

Keyboard shortcuts

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