Documentation ¶
Index ¶
- Constants
- Variables
- func BeginningOfTheDay(t time.Time) time.Time
- func Date(year int, month time.Month, day, hour, min, sec, nsec int) time.Time
- func DiffDay(t1, t2 time.Time) int32
- func Distance(p0, p1 Vec3f) float64
- func EndingOfTheDay(t time.Time) time.Time
- func GenRSAKey() error
- func GetNextHour() time.Time
- func GetNextMinute() time.Time
- func GetNextTime(hour, minute int) time.Time
- func GetTimeWithoutHours(t time.Time) time.Time
- func IsInvalidTime(data time.Time) bool
- func IsSameDay(time1 time.Time, time2 time.Time) bool
- func Magnitude(v Vec3f) float64
- func Max(x, y int) int
- func Maxi32(x, y int32) int32
- func Maxi64(x, y int64) int64
- func MidOfTheDay(t time.Time) time.Time
- func Milliseconds() int64
- func Min(x, y int) int
- func Mini64(x, y int64) int64
- func ModifyTimeOffset(add int64)
- func MondayBeginWeek() int64
- func NextIntervalTime(t1 time.Time, intervalSeconds int) time.Time
- func NextMondayBeginWeek() int64
- func Now() time.Time
- func NowTime() int64
- func Probability(ratio int) bool
- func Probability10000(ratio int) bool
- func RSAPrivateDecrypt(key, ciphertext []byte) ([]byte, error)
- func RSAPublicKeyEncrypt(key, data []byte) ([]byte, error)
- func Randx_y(x, y int) int
- func Seconds() int64
- func SqrDistance(p0, p1 Vec3f) float64
- func SqrMagnitude(v Vec3f) float64
- func TimeFormat(data time.Time) string
- func TimeParse(data string) time.Time
- func TimeParseFormat(layout, value string) (time.Time, error)
- func Try(fn func(), catch ...func(ex interface{}))
- func UUID() string
- func Unix(sec int64, nsec int64) time.Time
- func Valid(v Vec3f) bool
- func WeightSelect(len int, weightFn func(index int) int) int
- func XUID() string
- type Byte
- type EnumIdx
- type GetProtoByName
- type ProtoIndex
- func (s *ProtoIndex) FindMsgByName(msgName string) (proto.Message, bool)
- func (s *ProtoIndex) MsgIdToName(msgId int32) (msgName string, ok bool)
- func (s *ProtoIndex) MsgName(msg proto.Message) string
- func (s *ProtoIndex) MsgNameToId(msgName string) (msgId int32, ok bool)
- func (s *ProtoIndex) UnmarshalPbMsg(msgId int32, data []byte) proto.Message
- type Vec3f
Constants ¶
View Source
const ( SecondsPerDay = 24 * 60 * 60 SecondsForever = SecondsPerDay * 365 * 10 //10年(int32~(2020+17)) )
Variables ¶
View Source
var ( TimeZero = Unix(0, 0) TimeOffset int64 TimeOffsetPath = "./.timeoffset" )
Functions ¶
func GetNextHour ¶
func GetNextMinute ¶
func GetNextTime ¶
func IsInvalidTime ¶
func Milliseconds ¶
func Milliseconds() int64
func ModifyTimeOffset ¶ added in v1.1.4
func ModifyTimeOffset(add int64)
func MondayBeginWeek ¶
func MondayBeginWeek() int64
func NextIntervalTime ¶
以当天开始时间为初始值 间隔 intervalSeconds触发一次,返回下次触发的时间
func NextMondayBeginWeek ¶
func NextMondayBeginWeek() int64
func RSAPrivateDecrypt ¶ added in v1.2.20
RSAPrivateDecrypt 私钥解密
func RSAPublicKeyEncrypt ¶ added in v1.2.20
RSAPublicKeyEncrypt 公钥加密
func SqrDistance ¶
func SqrMagnitude ¶
func TimeFormat ¶
Types ¶
type GetProtoByName ¶ added in v1.2.0
type ProtoIndex ¶ added in v1.2.0
type ProtoIndex struct {
// contains filtered or unexported fields
}
func NewProtoIndex ¶ added in v1.2.0
func NewProtoIndex(f GetProtoByName, enum EnumIdx) *ProtoIndex
func (*ProtoIndex) FindMsgByName ¶ added in v1.2.0
func (s *ProtoIndex) FindMsgByName(msgName string) (proto.Message, bool)
func (*ProtoIndex) MsgIdToName ¶ added in v1.2.0
func (s *ProtoIndex) MsgIdToName(msgId int32) (msgName string, ok bool)
func (*ProtoIndex) MsgNameToId ¶ added in v1.2.0
func (s *ProtoIndex) MsgNameToId(msgName string) (msgId int32, ok bool)
func (*ProtoIndex) UnmarshalPbMsg ¶ added in v1.2.0
func (s *ProtoIndex) UnmarshalPbMsg(msgId int32, data []byte) proto.Message
Click to show internal directories.
Click to hide internal directories.