Versions in this module Expand all Collapse all v0 v0.1.1 Jul 4, 2020 Changes in this version + const LI_CATA_MULTI + const LI_FUNC_MULTI + const LI_INST_MULTI + const LI_MAX_ID + const LI_SUB_MULTI + var ACCESS_KEY_ID string = "LTAIDquqdpFdYVmW" + var ACCESS_KEY_SECRET string = "ozeRm4LWSqEnpPEw9spdOfylSNprY1" + var DOMAIN string = "dysmsapi.aliyuncs.com" + var ErrHttpStatusCode = errors.New("http return bad status code.") + var ErrInvalidLogicId = errors.New("Invalid logic id") + var ErrInvalidParams = errors.New("invalid parameters") + var ErrReturnValue = errors.New("sms return message means failed.") + var MESSAGE_SUCCESS string = "OK" + var PRODUCT string = "Dysmsapi" + var REGION string = "cn-hangzhou" + var SIGN_NAME string = "海拉科技" + var TEMPLATE_CODE string = "SMS_127790203" + var VERSION string = "2017-05-25" + func ConnectRedis(addr string, password string, db int32) (*redis.Client, error) + func ConnectRedisCluster(addrs []string, password string, db int32) (*redis.ClusterClient, error) + func GetCataIdByLogicId(logicId uint64) (uint64, error) + func GetFuncIdByLogicId(logicId uint64) (uint64, error) + func GetGameIdByLogicId(logicId uint64) (uint64, error) + func GetMacInfoImmutablePart(mac *MachMeta) + func GetMachInfo(mac *MachMeta) + func GetMachInfoMutablePart(mac *MachMeta) + func GetSubIdByLogicId(logicId uint64) (uint64, error) + func SendSmsTo(phone string, text string) error + type AppInfo struct + BootAt time.Time + ChQuit chan struct{} + ConfFile string + Debug bool + Ev *mq.Eventbus + InstName string + Log *log.SLogger + Mode string + Mq *mq.Mq + Name string + Offline int32 + Rdb *redis.Client + Ver *Version + Zk *ZkClient + func NewAppInfo(programeName string, major, minor, revision int, id uint64, confFile string, ...) *AppInfo + func (self *AppInfo) EnableLog(console bool, level int32, logPath string) error + func (self *AppInfo) RegisterSelf(parentPath string) error + type AppInfoOptions func(info *AppInfo) + func AppEnableLogger(enable bool, logLevel int32, logPath string, logStdout bool) AppInfoOptions + type Event struct + Err error + Path string + Type zk.EventType + type HttpClient struct + func NewHttpClient() *HttpClient + func (self *HttpClient) LastStatusCode() int + func (self *HttpClient) PostJson(url string, json []byte) ([]byte, error) + type HttpGin struct + func NewHttpGinServer(addr string, options ...HttpGinOptions) *HttpGin + func (self *HttpGin) Start(fnSetupRouter func(*gin.Engine)) error + func (self *HttpGin) Stop() error + type HttpGinOptions func(*HttpGin) + func EnableBlacklist(b []string) HttpGinOptions + func EnableCors(enable bool) HttpGinOptions + func EnableDebug(enable bool) HttpGinOptions + func EnableFlowControl(enable bool) HttpGinOptions + func EnableHTML(enable bool, ptn string) HttpGinOptions + func EnableSession(enable bool, store sessions.Store) HttpGinOptions + func EnableWhitelist(b []string) HttpGinOptions + type JwtTokener struct + func NewJwtTokener(key string) *JwtTokener + func (self *JwtTokener) Parse(token string) (jwt.MapClaims, error) + func (self *JwtTokener) Token(m map[string]interface{}) (string, error) + type LogicID struct + func NewLogicIDByID(id uint64) (*LogicID, error) + func NewLogicIDByParts(funcId, cataId, subId, instId uint64) (*LogicID, error) + func (self *LogicID) CataId() uint64 + func (self *LogicID) FuncId() uint64 + func (self *LogicID) GameId() uint64 + func (self *LogicID) HeaderCata() uint64 + func (self *LogicID) HeaderSub() uint64 + func (self *LogicID) Id() uint64 + func (self *LogicID) InstId() uint64 + func (self *LogicID) SubId() uint64 + type MachMeta struct + Arch string + BootTime uint64 + CpuCoreNum int32 + CpuModelName string + CpuNum int + CpuPercent []float64 + Hostname string + KernelVer string + MemAvailable uint64 + MemPercent float64 + MemTotal uint64 + MemUsed uint64 + OS string + Platform string + UpTime uint64 + type Mail struct + Attachments []string + Body string + Subject string + type MailReceiver struct + Addr string + Name string + type Mailer struct + func NewMailer(smtp string, port int, username, password string) *Mailer + func (self *Mailer) Send(mail Mail, receivers ...MailReceiver) error + type Version struct + func NewVersion(major, minor, revision int) *Version + func (self *Version) Major() int + func (self *Version) Minor() int + func (self *Version) Revision() int + func (self *Version) String() string + type ZkCallback func(c *ZkClient, path string, ev zk.EventType) + type ZkClient struct + func NewZkClient(hosts []string, root string, user string, password string, timeout int, ...) (*ZkClient, error) + func (self *ZkClient) Close() + func (self *ZkClient) CreateEmpNode(name string, data []byte) error + func (self *ZkClient) Exists(name string) bool + func (self *ZkClient) GetChildren(name string) ([]string, error) + func (self *ZkClient) GetNodeData(name string) ([]byte, error) + func (self *ZkClient) SetNodeData(path string, data []byte) error + func (self *ZkClient) WatchChildren(name string) error + func (self *ZkClient) WatchNode(name string) error