Documentation
¶
Index ¶
- Constants
- func AddInt64(a, b int64) (int64, bool)
- func BoolTo[T ...](b bool) T
- func BytesAsStr(b []byte) string
- func GetFileSize(filePath string) (int64, error)
- func GetLastResetTime(nowMs int64, resetHour int64) int64
- func GetLastWeekResetTime(nowMs int64, resetHour, resetWeekDay int64) int64
- func GetLocation() *time.Location
- func GetMessageFullName(msg proto.Message) string
- func GetMessageName(msg proto.Message) string
- func GetNextDayResetTime(nowMs int64, resetHour int64) int64
- func GetNextWeekResetTime(nowMs int64, resetHour, resetWeekDay int64) int64
- func GetTimeOffset() time.Duration
- func GetTimeZoneOffset() int64
- func GetWeekday(nowMs int64) int64
- func GoroutineID() int
- func IsNewDayReset(before, after int64, resetHour int64) bool
- func IsWeekReset(before, after int64, resetHour, resetWeekDay int64) bool
- func MakeMessageByFullName(fullName string) (proto.Message, error)
- func Ms2DateValue(t int64) int64
- func Ms2Time(ms int64) time.Time
- func NewMessageByFullName(fullName string, data []byte) (proto.Message, error)
- func Now() time.Time
- func NowMs() int64
- func OpenFile(fullpath string) (*os.File, error)
- func RotateLogFile(filePath string) (*os.File, error)
- func SetTimeOffset(newOffset time.Duration)
- func SetTimezone(offsetSeconds int64)
- func StrAsBytes(s string) []byte
- func Time2Ms(t time.Time) int64
- func UpperFirst(str string) string
Constants ¶
View Source
const ( SecMs = 1000 MinMs = 60 * SecMs HourMs = 60 * MinMs DayMs = 24 * HourMs WeekMs = 7 * DayMs )
View Source
const TimeFormat = "2006-01-02T15:04:05.000Z"
Variables ¶
This section is empty.
Functions ¶
func BytesAsStr ¶
func GetFileSize ¶
func GetLastResetTime ¶
GetLastResetTime 获取当前时间的上次跨天时间戳,nowMs为时间戳ms
func GetLastWeekResetTime ¶
GetLastWeekResetTime 获取当前时间的上次跨周时间戳,nowMs为时间戳ms
func GetLocation ¶
func GetMessageFullName ¶
GetMessageFullName 返回 game.CLoginSLG
func GetMessageName ¶
GetMessageName 从 game.CLoginSLG 中获取 CLoginSLG
func GetNextDayResetTime ¶
GetNextDayResetTime 获取下次重置时间戳, nowMs为UTC时间戳
func GetNextWeekResetTime ¶
GetNextWeekResetTime 获取下周重置时间(时刻), nowMs为UTC时间戳ms, 周天0和7都合法
func GoroutineID ¶
func GoroutineID() int
func IsNewDayReset ¶
IsNewDayReset 是否跨天某一小时, before\after为UTC时间戳ms, hour(0-23)
func IsWeekReset ¶
IsWeekReset 是否跨周before, after为UTC时间戳ms
func MakeMessageByFullName ¶
MakeMessageByFullName 根据proto全类名获取Message实例 game.CLoginSLG
func NewMessageByFullName ¶
NewMessageByFullName 根据proto全类名获取Message实例 game.CLoginSLG
func StrAsBytes ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.