Versions in this module Expand all Collapse all v0 v0.2.0 Feb 12, 2022 Changes in this version + const ConfigEnv + const ConfigFile + const DateFormat + const DateHourFormat + const DateTimeFormat + const HourMinuteOnlyFormat + const InnerToken + const MonthFormat + const SEND_TIMEOUT_SECOND + const ShortDateFormat + const ShortTimeFormat + const TimeFormat + const TimeOnlyFormat + var ErrConnSendTimeout = errors.New("Connection send timeout") + var ErrDataIsNil = errors.New("Send data is nil") + var RR = &RoomDataReciver + var RS = &RoomDataSender + func BytesToPrivateKey(priv []byte) (*rsa.PrivateKey, error) + func CNYFen2Yuan(fen int64) float64 + func CNYYuan2Fen(yuan float64) int64 + func CreateDir(dirs ...string) (err error) + func CustomTimeEncoder(t time.Time, enc zapcore.PrimitiveArrayEncoder) + func DateEqual(date1, date2 time.Time) bool + func ExistInIds(id int64, ids []int64) bool + func GetDatePart(t time.Time) string + func GetDatePartNumber(t time.Time) int + func GetDateTime(t time.Time) string + func GetDayDateRange(t time.Time) (dayStart, dayEnd time.Time) + func GetEightHourTimeRange(timeObj time.Time) (start time.Time, end time.Time) + func GetFewDaysAgo(t1 time.Time, days int) time.Time + func GetMonthDateRange(t time.Time) (monthStart, monthEnd time.Time) + func GetNowTimeUTC() string + func GetTimePart(t time.Time) string + func GetTodayAndTomorrowString(t1 time.Time) (string, string) + func GetWeekDateRange(t time.Time) (weekStart, weekEnd time.Time) + func GetWriteSyncer() (zapcore.WriteSyncer, error) + func GetYesterdayDateRange() (dayStart, dayEnd time.Time) + func GormMysql(cfg config.Mysql) *gorm.DB + func MD5(text string) string + func NewConsumer(topic string, channel string, maxInFlight int) (*nsq.Consumer, error) + func NewIMServer(cfg config.TencentIM) *tencentIM.IMServer + func NewMongoConn(cfg config.Mongo) *mongo.Client + func NewProducer() *nsq.Producer + func ParseDate(str string) (time.Time, error) + func ParseStingDateTimeToTimeObj(str string) time.Time + func ParseStingDateToTimeObj(str string) time.Time + func PathExists(path string) (bool, error) + func RandInt64(min, max int64) int64 + func Redis(cfg config.Redis) *redis.Client + func Viper(path ...string) *viper.Viper + func Zap() (logger *zap.Logger) + type ConsumerT struct + Func func(*pb.RoomPushData) + RoomDataReciverPtr *RoomDataReciver + func (c ConsumerT) HandleMessage(message *nsq.Message) error + type RoomDataReciver struct + RecvMsgQueue chan *pb.RoomPushData + func (r *RoomDataReciver) NewRoomDataReciver(channel string, maxInFlight, concurrency int, f func(data *pb.RoomPushData)) (*nsq.Consumer, error) + type RoomDataSender struct + func (p *RoomDataSender) Run() + func (r *RoomDataSender) InitRoomDataSender() + func (r *RoomDataSender) Publish(roomId int64, msgType int32, data []byte) error + func (r *RoomDataSender) PublishDirect(topic string, data []byte) error