Documentation ¶
Index ¶
- func CreateCaptcha() string
- func GetActionByPb(action proto.Action) consts.BranchAction
- func GetTranTypeByPb(protoType proto.TranType) consts.TransactionType
- func GitGid() string
- 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"` // global id BranchId string `gorm:"column:branch_id;not null"` // branch id Url string `gorm:"column:url;not null"` // branch request url (example grpc or http) ReqData string `gorm:"column:req_data;not null"` // request data ReqHeader string `gorm:"column:req_header;not null"` // request data TranType consts.TransactionType `gorm:"column:tran_type;not null"` // transaction type:tcc or saga or others Protocol string `gorm:"column:protocol;not null;default:http"` //http,grpc Action consts.BranchAction `gorm:"column:action;not null"` // action type of transaction State consts.BranchState `gorm:"column:state;not null;default:init"` // branch State Level consts.Level `gorm:"column:level;not null;default:1"` // branch level in tree LastErrMsg string `gorm:"column:last_err_msg;not null"` Timeout int64 `gorm:"column:timeout;not null;default:0"` //request branch timeout(seconds) CreateTime int64 `gorm:"create_time;autoCreateTime" json:"create_time"` // create time UpdateTime int64 `gorm:"update_time;autoCreateTime" json:"update_time"` // last update time }
func (*Branch) AssignmentByPb ¶
func (b *Branch) AssignmentByPb(m *proto.RegisterReq_Branch) *Branch
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"` // global id State consts.GlobalState `gorm:"column:state;type:varchar(255);not null;default:init"` // global State EndTime int64 `gorm:"column:end_time;type:int;not null;default:0"` // end time for the transaction TryTimes int64 `gorm:"column:try_times;type:int;not null;default:0"` // try times NextCronTime int64 `gorm:"column:next_cron_time;type:int;not null;default:0"` // next cron time CreateTime int64 `gorm:"create_time;autoCreateTime" json:"create_time"` // create time UpdateTime int64 `gorm:"update_time;autoCreateTime" json:"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.