Create & Init Project...

This commit is contained in:
2019-04-22 18:49:16 +08:00
commit fc4fa37393
25440 changed files with 4054998 additions and 0 deletions

View File

@ -0,0 +1,34 @@
package common
import "fmt"
const (
_ctypeSN = "retry_sn"
_ctypeEP = "retry_ep"
)
// SyncRetry is the struct used for retry info storage
type SyncRetry struct {
Ctype string
Retry int
CID int64
}
// FromSn def.
func (v *SyncRetry) FromSn(retry int, sid int64) {
v.Ctype = _ctypeSN
v.Retry = retry
v.CID = sid
}
// FromEp def.
func (v *SyncRetry) FromEp(retry int, epid int64) {
v.Ctype = _ctypeEP
v.Retry = retry
v.CID = epid
}
// MCKey def.
func (v *SyncRetry) MCKey() (key string) {
return v.Ctype + "_" + fmt.Sprintf("%d", v.CID)
}