Documentation ¶
Index ¶
- func CreateCaptcha() string
- func GetActionByPb(action proto.Action) consts.BranchAction
- func GetGid() string
- func GetTranTypeByPb(protoType proto.TranType) consts.TransactionType
- type Branch
- func (b *Branch) AssignmentByPb(m *proto.RegisterReq_Branch) *Branch
- func (b *Branch) IsTcc() bool
- func (b *Branch) SAGA() bool
- func (b *Branch) SAGACompensation() bool
- func (b *Branch) SAGANormal() bool
- func (b *Branch) Success() bool
- func (b *Branch) TableName() string
- func (b *Branch) TccCancel() bool
- func (b *Branch) TccConfirm() bool
- func (b *Branch) TccTry() bool
- type BranchList
- type Global
- func (g *Global) AllowRegister() bool
- func (g *Global) GetEndTime() int64
- func (g *Global) GetGId() string
- func (g *Global) GetState() consts.GlobalState
- func (g *Global) GotoCommit() bool
- func (g *Global) GotoRollback() bool
- func (g *Global) Init() bool
- func (g *Global) IsEmpty() bool
- func (g *Global) Phase1() bool
- func (g *Global) Phase2() bool
- func (g *Global) SetGId(gId string)
- func (g *Global) SetState(state consts.GlobalState)
- func (g *Global) TableName() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateCaptcha ¶
func CreateCaptcha() string
func GetActionByPb ¶
func GetActionByPb(action proto.Action) consts.BranchAction
func GetTranTypeByPb ¶
func GetTranTypeByPb(protoType proto.TranType) consts.TransactionType
Types ¶
type Branch ¶
type Branch struct { GID string `gorm:"column:g_id;not null" bson:"g_id"` // global id BranchId string `gorm:"column:branch_id;not null" bson:"branch_id"` // branch id Url string `gorm:"column:url;not null" bson:"url"` // branch request url (example grpc or http) ReqData string `gorm:"column:req_data;not null" bson:"req_data"` // request data ReqHeader string `gorm:"column:req_header;not null" bson:"req_header"` // request data TranType consts.TransactionType `gorm:"column:tran_type;not null" bson:"tran_type"` // transaction type:tcc or saga or others Protocol string `gorm:"column:protocol;not null;default:http" bson:"protocol"` //http,grpc Action consts.BranchAction `gorm:"column:action;not null" bson:"action"` // action type of transaction State consts.BranchState `gorm:"column:state;not null;default:init" bson:"state"` // branch State Level consts.Level `gorm:"column:level;not null;default:1" bson:"level"` // branch level in tree LastErrMsg string `gorm:"column:last_err_msg;not null" bson:"last_err_msg"` Timeout int64 `gorm:"column:timeout;not null;default:0" bson:"timeout"` //request branch timeout(seconds) CreateTime int64 `gorm:"create_time;autoCreateTime" json:"create_time" bson:"create_time"` // create time UpdateTime int64 `gorm:"update_time;autoCreateTime" json:"update_time" bson:"update_time"` // last update time }
func (*Branch) AssignmentByPb ¶
func (b *Branch) AssignmentByPb(m *proto.RegisterReq_Branch) *Branch
AssignmentByPb todo
func (*Branch) SAGACompensation ¶
func (*Branch) SAGANormal ¶
func (*Branch) TccConfirm ¶
type BranchList ¶
type BranchList []*Branch
func GetBranchList ¶
func GetBranchList(gid string, mList []*proto.RegisterReq_Branch) (list BranchList)
type Global ¶
type Global struct { GID string `gorm:"column:g_id;type:varchar(255);not null" bson:"g_id"` // global id State consts.GlobalState `gorm:"column:state;type:varchar(255);not null;default:init" bson:"state"` // global State EndTime int64 `gorm:"column:end_time;type:int;not null;default:0" bson:"end_time"` // end time for the transaction TryTimes int64 `gorm:"column:try_times;type:int;not null;default:0" bson:"try_times"` // try times NextCronTime int64 `gorm:"column:next_cron_time;type:int;not null;default:0" bson:"next_cron_time"` // next cron time CreateTime int64 `gorm:"create_time;autoCreateTime" json:"create_time" bson:"create_time"` // create time UpdateTime int64 `gorm:"update_time;autoCreateTime" json:"update_time" bson:"update_time"` // last update time }
func (*Global) AllowRegister ¶
func (*Global) GetEndTime ¶
func (*Global) GetState ¶
func (g *Global) GetState() consts.GlobalState
func (*Global) GotoCommit ¶
func (*Global) GotoRollback ¶
func (*Global) SetState ¶
func (g *Global) SetState(state consts.GlobalState)
Click to show internal directories.
Click to hide internal directories.