Documentation
¶
Index ¶
- Constants
- func DecodeBinToPayload(data []byte, kcpMsgList *[]*PackMsg, xorKey []byte)
- func DecodeLoop(data []byte, kcpMsgList *[]*PackMsg)
- func DecodePayloadToProto(msg *PackMsg) (protoObj pb.Message)
- func EncodePayloadToBin(kcpMsg *PackMsg, xorKey []byte) (bin []byte)
- func GetAppId() string
- func GetAppIdStr(appId uint32) string
- func GetAppIdUint32(appid string) uint32
- func GetEc2b() *random.Ec2b
- func GetEveryDay4() time.Duration
- func MaxUin32(x, y uint32) uint32
- func S2U32(msg string) uint32
- type PackMsg
- type ProtoMsg
- type SnowflakeWorker
Constants ¶
View Source
const (
PacketMaxLen = 343 * 1024 // 最大应用层包长度
)
Variables ¶
This section is empty.
Functions ¶
func DecodeBinToPayload ¶
func DecodeLoop ¶
func DecodePayloadToProto ¶
func EncodePayloadToBin ¶
func GetAppIdStr ¶ added in v1.2.1
func GetAppIdUint32 ¶ added in v1.2.1
func GetEveryDay4 ¶ added in v1.2.1
Types ¶
type PackMsg ¶
func EncodeProtoToPayload ¶
type SnowflakeWorker ¶
type SnowflakeWorker struct {
// contains filtered or unexported fields
}
func NewSnowflakeWorker ¶
func NewSnowflakeWorker(workerId int64) *SnowflakeWorker
func (*SnowflakeWorker) GenId ¶
func (s *SnowflakeWorker) GenId() int64
Click to show internal directories.
Click to hide internal directories.