Documentation ¶
Index ¶
- Constants
- Variables
- func GenerateNormalId() int64
- func GenerateNormalId6() int64
- func GetRunHTTPPort() (port string)
- func LoadConf(file string) (cfg *ini.File, err error)
- func MD5(text string) string
- func NewNormalid(workerid int64) (*id, error)
- func RandomStr(size int, Random int) string
- func RandomStr2(size int, Random int, stype int) string
- type Info1
- type Info2
- type Worker
- type XRegister
- type XRegisterBetaMiniprogram
- type XRegisterBetaMiniprogram2
Constants ¶
View Source
const ( EBUSY = 40001 EBUSYS = "系统繁忙请稍后再试" EEXPIRE = 40002 EEXPIRES = "您的账号已经过期该部分功能已经被限制" EAUTHLOGIN = 401 //权限错误 EAUTHLOGINS = "登录已经过期了需要重新登录" //权限错误 SUCCESS = 0 NOFOUNTUSER = 2 EUNKNOWN = 10001 //未知错误 EDBERR = 10002 //数据库错误 EMTHNOTFOUND = 10003 //方法不存在 EDTNOTFOUND = 10004 //数据不存在 ERENDER = 10008 //渲染出错 EAUTH = 10009 //权限错误 EFORMAT = 10010 //参数格式错误 EDATA = 10011 //数据错误 EMPLOGIN = 10012 //登录错误 EPASSWORD = 10013 //密码错误 ELOGINS = 20001 ELOGINC = 20002 ECAPT = 20003 EECAPT = 20004 EPASSWD = 20005 ELOGIND = 20006 EECAPTEXP = 20007 ESYN = 30001 ESYNS = "命令发送失败" EUNKNOWNS = "未知错误" EDBERRS = "数据库错误" EMTHNOTFOUNDS = "方法不存在" EDTNOTFOUNDS = "数据不存在" EAUTHS = "权限错误" EFORMATS = "数据格式错误" EDATAS = "数据错误" SUCCESSS = "成功" SUCCESSSYN = "成功,请等待同步" SUCCESSAS = "添加成功" SUCCESSUS = "修改成功" SUCCESSDS = "删除成功" ELOGINSS = "您已经登录了" NOFOUNTUSERS = "用户不存在" ELOGINCS = "请合理使用资源" ELOGINDS = "您的账号被禁用,请联系管理员" ECAPTS = "验证码错误" EUSERPASSWDS = "请检查用户名和密码" EPASSWORDS = "密码错误" SUCCESSLOGINS = "登陆成功" SUCCEPASSWD = "密码修改成功" SUCCCAPT = "验证码发送成功" CFILENOTFOUND = 90001 CMD5 = 90002 CTORAGE = 9004 )
错误代码定义
Variables ¶
View Source
var ( //Userid 交易模块的雪花ID FastId *id NormalId *id )
View Source
var (
Cfg *ini.File
)
系统配置参数
Functions ¶
func GenerateNormalId ¶
func GenerateNormalId() int64
Generate creates and returns a unique normalId ID Generate creates and returns a unique normalId ID
func GenerateNormalId6 ¶
func GenerateNormalId6() int64
Generate creates and returns a unique normalId ID
func NewNormalid ¶
Newnormalid NewNode returns a new normalId worker that can be used to generate normalId IDs
Types ¶
type Worker ¶
type Worker struct { LastStamp int64 // 记录上一次ID的时间戳 WorkerID int64 // 该节点的ID DataCenterID int64 // 该节点的 数据中心ID Sequence int64 // 当前毫秒已经生成的ID序列号(从0 开始累加) 1毫秒内最多生成4096个ID // contains filtered or unexported fields }
type XRegisterBetaMiniprogram ¶
type XRegisterBetaMiniprogram struct { CommentAppID string `xml:"AppId"` // 第三方平台appid CreateTime string `xml:"CreateTime"` InfoType string `xml:"InfoType"` AppID string `xml:"appid"` Status int `xml:"status"` Msg string `xml:"msg"` Info struct { Name string `xml:"name"` UniqueId string `xml:"unique_id"` } `xml:"info"` }
func TestEvent ¶
func TestEvent(result string) (event *XRegisterBetaMiniprogram, err error)
type XRegisterBetaMiniprogram2 ¶
type XRegisterBetaMiniprogram2 struct { CommentAppID string `xml:"AppId"` // 第三方平台appid CreateTime string `xml:"CreateTime"` InfoType string `xml:"InfoType"` AppID string `xml:"appid"` Status int `xml:"status"` Msg string `xml:"msg"` Info struct { Name string `xml:"name"` Code string `xml:"code"` CodeType int `xml:"code_type"` LegalPersonaWechat string `xml:"legal_persona_wechat"` LegalPersonaName string `xml:"legal_persona_name"` ComponentPhone string `xml:"component_phone"` } `xml:"info"` }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.