pb

package
v0.0.0-...-daf8b82 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	SagaRequest_CallType_name = map[int32]string{
		0: "SYNC",
		1: "ASYNC",
	}
	SagaRequest_CallType_value = map[string]int32{
		"SYNC":  0,
		"ASYNC": 1,
	}
)

Enum value maps for SagaRequest_CallType.

View Source
var Ap_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "saga.Ap",
	HandlerType: (*ApServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Notify",
			Handler:    _Ap_Notify_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "ap.proto",
}

Ap_ServiceDesc is the grpc.ServiceDesc for Ap 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 File_common_proto protoreflect.FileDescriptor
View Source
var Tc_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "saga.Tc",
	HandlerType: (*TcServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "NewGtid",
			Handler:    _Tc_NewGtid_Handler,
		},
		{
			MethodName: "Commit",
			Handler:    _Tc_Commit_Handler,
		},
		{
			MethodName: "Get",
			Handler:    _Tc_Get_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "tc.proto",
}

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

Functions

func RegisterApServer

func RegisterApServer(s grpc.ServiceRegistrar, srv ApServer)

func RegisterTcServer

func RegisterTcServer(s grpc.ServiceRegistrar, srv TcServer)

Types

type ApClient

type ApClient interface {
	Notify(ctx context.Context, in *ApNotifyRequest, opts ...grpc.CallOption) (*empty.Empty, error)
}

ApClient is the client API for Ap 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 NewApClient

func NewApClient(cc grpc.ClientConnInterface) ApClient

type ApNotifyRequest

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

func (*ApNotifyRequest) Descriptor deprecated

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

Deprecated: Use ApNotifyRequest.ProtoReflect.Descriptor instead.

func (*ApNotifyRequest) GetSaga

func (x *ApNotifyRequest) GetSaga() *Saga

func (*ApNotifyRequest) ProtoMessage

func (*ApNotifyRequest) ProtoMessage()

func (*ApNotifyRequest) ProtoReflect

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

func (*ApNotifyRequest) Reset

func (x *ApNotifyRequest) Reset()

func (*ApNotifyRequest) String

func (x *ApNotifyRequest) String() string

type ApServer

type ApServer interface {
	Notify(context.Context, *ApNotifyRequest) (*empty.Empty, error)
	// contains filtered or unexported methods
}

ApServer is the server API for Ap service. All implementations must embed UnimplementedApServer for forward compatibility

type Saga

type Saga struct {
	Gtid     string        `protobuf:"bytes,1,opt,name=gtid,proto3" json:"gtid,omitempty"`
	State    string        `protobuf:"bytes,2,opt,name=state,proto3" json:"state,omitempty"`
	Branches []*SagaBranch `protobuf:"bytes,3,rep,name=branches,proto3" json:"branches,omitempty"`
	Msg      string        `protobuf:"bytes,4,opt,name=msg,proto3" json:"msg,omitempty"`
	// contains filtered or unexported fields
}

func (*Saga) Descriptor deprecated

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

Deprecated: Use Saga.ProtoReflect.Descriptor instead.

func (*Saga) GetBranches

func (x *Saga) GetBranches() []*SagaBranch

func (*Saga) GetGtid

func (x *Saga) GetGtid() string

func (*Saga) GetMsg

func (x *Saga) GetMsg() string

func (*Saga) GetState

func (x *Saga) GetState() string

func (*Saga) ProtoMessage

func (*Saga) ProtoMessage()

func (*Saga) ProtoReflect

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

func (*Saga) Reset

func (x *Saga) Reset()

func (*Saga) String

func (x *Saga) String() string

type SagaBranch

type SagaBranch struct {
	BranchId int32  `protobuf:"varint,1,opt,name=branch_id,json=branchId,proto3" json:"branch_id,omitempty"`
	State    string `protobuf:"bytes,2,opt,name=state,proto3" json:"state,omitempty"`
	Payload  []byte `protobuf:"bytes,3,opt,name=payload,proto3" json:"payload,omitempty"`
	// contains filtered or unexported fields
}

func (*SagaBranch) Descriptor deprecated

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

Deprecated: Use SagaBranch.ProtoReflect.Descriptor instead.

func (*SagaBranch) GetBranchId

func (x *SagaBranch) GetBranchId() int32

func (*SagaBranch) GetPayload

func (x *SagaBranch) GetPayload() []byte

func (*SagaBranch) GetState

func (x *SagaBranch) GetState() string

func (*SagaBranch) ProtoMessage

func (*SagaBranch) ProtoMessage()

func (*SagaBranch) ProtoReflect

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

func (*SagaBranch) Reset

func (x *SagaBranch) Reset()

func (*SagaBranch) String

func (x *SagaBranch) String() string

type SagaBranchRequest

type SagaBranchRequest struct {
	BranchId     int32                           `protobuf:"varint,1,opt,name=branch_id,json=branchId,proto3" json:"branch_id,omitempty"`
	Commit       *SagaBranchRequest_Commit       `protobuf:"bytes,2,opt,name=commit,proto3" json:"commit,omitempty"`
	Compensation *SagaBranchRequest_Compensation `protobuf:"bytes,3,opt,name=compensation,proto3" json:"compensation,omitempty"`
	Payload      []byte                          `protobuf:"bytes,4,opt,name=payload,proto3" json:"payload,omitempty"`
	// contains filtered or unexported fields
}

func (*SagaBranchRequest) Descriptor deprecated

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

Deprecated: Use SagaBranchRequest.ProtoReflect.Descriptor instead.

func (*SagaBranchRequest) GetBranchId

func (x *SagaBranchRequest) GetBranchId() int32

func (*SagaBranchRequest) GetCommit

func (*SagaBranchRequest) GetCompensation

func (x *SagaBranchRequest) GetCompensation() *SagaBranchRequest_Compensation

func (*SagaBranchRequest) GetPayload

func (x *SagaBranchRequest) GetPayload() []byte

func (*SagaBranchRequest) ProtoMessage

func (*SagaBranchRequest) ProtoMessage()

func (*SagaBranchRequest) ProtoReflect

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

func (*SagaBranchRequest) Reset

func (x *SagaBranchRequest) Reset()

func (*SagaBranchRequest) String

func (x *SagaBranchRequest) String() string

type SagaBranchRequest_Commit

type SagaBranchRequest_Commit struct {
	Action  string                   `protobuf:"bytes,1,opt,name=action,proto3" json:"action,omitempty"`
	Timeout *duration.Duration       `protobuf:"bytes,2,opt,name=timeout,proto3" json:"timeout,omitempty"`
	Retry   *SagaBranchRequest_Retry `protobuf:"bytes,3,opt,name=retry,proto3" json:"retry,omitempty"`
	// contains filtered or unexported fields
}

func (*SagaBranchRequest_Commit) Descriptor deprecated

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

Deprecated: Use SagaBranchRequest_Commit.ProtoReflect.Descriptor instead.

func (*SagaBranchRequest_Commit) GetAction

func (x *SagaBranchRequest_Commit) GetAction() string

func (*SagaBranchRequest_Commit) GetRetry

func (*SagaBranchRequest_Commit) GetTimeout

func (x *SagaBranchRequest_Commit) GetTimeout() *duration.Duration

func (*SagaBranchRequest_Commit) ProtoMessage

func (*SagaBranchRequest_Commit) ProtoMessage()

func (*SagaBranchRequest_Commit) ProtoReflect

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

func (*SagaBranchRequest_Commit) Reset

func (x *SagaBranchRequest_Commit) Reset()

func (*SagaBranchRequest_Commit) String

func (x *SagaBranchRequest_Commit) String() string

type SagaBranchRequest_Compensation

type SagaBranchRequest_Compensation struct {
	Action  string             `protobuf:"bytes,1,opt,name=action,proto3" json:"action,omitempty"`
	Timeout *duration.Duration `protobuf:"bytes,2,opt,name=timeout,proto3" json:"timeout,omitempty"`
	Retry   *duration.Duration `protobuf:"bytes,3,opt,name=retry,proto3" json:"retry,omitempty"`
	// contains filtered or unexported fields
}

func (*SagaBranchRequest_Compensation) Descriptor deprecated

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

Deprecated: Use SagaBranchRequest_Compensation.ProtoReflect.Descriptor instead.

func (*SagaBranchRequest_Compensation) GetAction

func (x *SagaBranchRequest_Compensation) GetAction() string

func (*SagaBranchRequest_Compensation) GetRetry

func (*SagaBranchRequest_Compensation) GetTimeout

func (*SagaBranchRequest_Compensation) ProtoMessage

func (*SagaBranchRequest_Compensation) ProtoMessage()

func (*SagaBranchRequest_Compensation) ProtoReflect

func (*SagaBranchRequest_Compensation) Reset

func (x *SagaBranchRequest_Compensation) Reset()

func (*SagaBranchRequest_Compensation) String

type SagaBranchRequest_Retry

type SagaBranchRequest_Retry struct {
	MaxRetry int32                            `protobuf:"varint,1,opt,name=max_retry,json=maxRetry,proto3" json:"max_retry,omitempty"`
	Strategy *SagaBranchRequest_RetryStrategy `protobuf:"bytes,2,opt,name=strategy,proto3" json:"strategy,omitempty"`
	// contains filtered or unexported fields
}

func (*SagaBranchRequest_Retry) Descriptor deprecated

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

Deprecated: Use SagaBranchRequest_Retry.ProtoReflect.Descriptor instead.

func (*SagaBranchRequest_Retry) GetMaxRetry

func (x *SagaBranchRequest_Retry) GetMaxRetry() int32

func (*SagaBranchRequest_Retry) GetStrategy

func (*SagaBranchRequest_Retry) ProtoMessage

func (*SagaBranchRequest_Retry) ProtoMessage()

func (*SagaBranchRequest_Retry) ProtoReflect

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

func (*SagaBranchRequest_Retry) Reset

func (x *SagaBranchRequest_Retry) Reset()

func (*SagaBranchRequest_Retry) String

func (x *SagaBranchRequest_Retry) String() string

type SagaBranchRequest_RetryStrategy

type SagaBranchRequest_RetryStrategy struct {

	// Types that are assignable to Strategy:
	//	*SagaBranchRequest_RetryStrategy_Constant
	Strategy isSagaBranchRequest_RetryStrategy_Strategy `protobuf_oneof:"strategy"`
	// contains filtered or unexported fields
}

func (*SagaBranchRequest_RetryStrategy) Descriptor deprecated

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

Deprecated: Use SagaBranchRequest_RetryStrategy.ProtoReflect.Descriptor instead.

func (*SagaBranchRequest_RetryStrategy) GetConstant

func (*SagaBranchRequest_RetryStrategy) GetStrategy

func (m *SagaBranchRequest_RetryStrategy) GetStrategy() isSagaBranchRequest_RetryStrategy_Strategy

func (*SagaBranchRequest_RetryStrategy) ProtoMessage

func (*SagaBranchRequest_RetryStrategy) ProtoMessage()

func (*SagaBranchRequest_RetryStrategy) ProtoReflect

func (*SagaBranchRequest_RetryStrategy) Reset

func (*SagaBranchRequest_RetryStrategy) String

type SagaBranchRequest_RetryStrategy_Constant

type SagaBranchRequest_RetryStrategy_Constant struct {
	Constant *duration.Duration `protobuf:"bytes,1,opt,name=constant,proto3,oneof"`
}

type SagaNotify

type SagaNotify struct {
	Action  string             `protobuf:"bytes,1,opt,name=action,proto3" json:"action,omitempty"`
	Timeout *duration.Duration `protobuf:"bytes,2,opt,name=timeout,proto3" json:"timeout,omitempty"`
	Retry   *duration.Duration `protobuf:"bytes,3,opt,name=retry,proto3" json:"retry,omitempty"`
	// contains filtered or unexported fields
}

func (*SagaNotify) Descriptor deprecated

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

Deprecated: Use SagaNotify.ProtoReflect.Descriptor instead.

func (*SagaNotify) GetAction

func (x *SagaNotify) GetAction() string

func (*SagaNotify) GetRetry

func (x *SagaNotify) GetRetry() *duration.Duration

func (*SagaNotify) GetTimeout

func (x *SagaNotify) GetTimeout() *duration.Duration

func (*SagaNotify) ProtoMessage

func (*SagaNotify) ProtoMessage()

func (*SagaNotify) ProtoReflect

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

func (*SagaNotify) Reset

func (x *SagaNotify) Reset()

func (*SagaNotify) String

func (x *SagaNotify) String() string

type SagaRequest

type SagaRequest struct {
	Gtid       string               `protobuf:"bytes,1,opt,name=gtid,proto3" json:"gtid,omitempty"`
	Business   string               `protobuf:"bytes,2,opt,name=business,proto3" json:"business,omitempty"`
	Notify     *SagaNotify          `protobuf:"bytes,3,opt,name=notify,proto3" json:"notify,omitempty"`
	ExpireTime *timestamp.Timestamp `protobuf:"bytes,4,opt,name=expire_time,json=expireTime,proto3" json:"expire_time,omitempty"`
	CallType   SagaRequest_CallType `protobuf:"varint,5,opt,name=call_type,json=callType,proto3,enum=saga.SagaRequest_CallType" json:"call_type,omitempty"`
	Branches   []*SagaBranchRequest `protobuf:"bytes,6,rep,name=branches,proto3" json:"branches,omitempty"`
	// contains filtered or unexported fields
}

func (*SagaRequest) Descriptor deprecated

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

Deprecated: Use SagaRequest.ProtoReflect.Descriptor instead.

func (*SagaRequest) GetBranches

func (x *SagaRequest) GetBranches() []*SagaBranchRequest

func (*SagaRequest) GetBusiness

func (x *SagaRequest) GetBusiness() string

func (*SagaRequest) GetCallType

func (x *SagaRequest) GetCallType() SagaRequest_CallType

func (*SagaRequest) GetExpireTime

func (x *SagaRequest) GetExpireTime() *timestamp.Timestamp

func (*SagaRequest) GetGtid

func (x *SagaRequest) GetGtid() string

func (*SagaRequest) GetNotify

func (x *SagaRequest) GetNotify() *SagaNotify

func (*SagaRequest) ProtoMessage

func (*SagaRequest) ProtoMessage()

func (*SagaRequest) ProtoReflect

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

func (*SagaRequest) Reset

func (x *SagaRequest) Reset()

func (*SagaRequest) String

func (x *SagaRequest) String() string

type SagaRequest_CallType

type SagaRequest_CallType int32
const (
	SagaRequest_SYNC  SagaRequest_CallType = 0
	SagaRequest_ASYNC SagaRequest_CallType = 1
)

func (SagaRequest_CallType) Descriptor

func (SagaRequest_CallType) Enum

func (SagaRequest_CallType) EnumDescriptor deprecated

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

Deprecated: Use SagaRequest_CallType.Descriptor instead.

func (SagaRequest_CallType) Number

func (SagaRequest_CallType) String

func (x SagaRequest_CallType) String() string

func (SagaRequest_CallType) Type

type SagaResponse

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

func (*SagaResponse) Descriptor deprecated

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

Deprecated: Use SagaResponse.ProtoReflect.Descriptor instead.

func (*SagaResponse) GetSaga

func (x *SagaResponse) GetSaga() *Saga

func (*SagaResponse) ProtoMessage

func (*SagaResponse) ProtoMessage()

func (*SagaResponse) ProtoReflect

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

func (*SagaResponse) Reset

func (x *SagaResponse) Reset()

func (*SagaResponse) String

func (x *SagaResponse) String() string

type TcClient

type TcClient interface {
	NewGtid(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*SagaResponse, error)
	Commit(ctx context.Context, in *SagaRequest, opts ...grpc.CallOption) (*SagaResponse, error)
	Get(ctx context.Context, in *SagaRequest, opts ...grpc.CallOption) (*SagaResponse, error)
}

TcClient is the client API for Tc 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 NewTcClient

func NewTcClient(cc grpc.ClientConnInterface) TcClient

type TcServer

type TcServer interface {
	NewGtid(context.Context, *empty.Empty) (*SagaResponse, error)
	Commit(context.Context, *SagaRequest) (*SagaResponse, error)
	Get(context.Context, *SagaRequest) (*SagaResponse, error)
	// contains filtered or unexported methods
}

TcServer is the server API for Tc service. All implementations must embed UnimplementedTcServer for forward compatibility

type UnimplementedApServer

type UnimplementedApServer struct {
}

UnimplementedApServer must be embedded to have forward compatible implementations.

func (UnimplementedApServer) Notify

type UnimplementedTcServer

type UnimplementedTcServer struct {
}

UnimplementedTcServer must be embedded to have forward compatible implementations.

func (UnimplementedTcServer) Commit

func (UnimplementedTcServer) Get

func (UnimplementedTcServer) NewGtid

type UnsafeApServer

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

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

type UnsafeTcServer

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

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

Jump to

Keyboard shortcuts

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