behavior

package
v0.1.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 20, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// 行为类型
	BehaviorTypes = struct {
		// 上线
		Online int
		// 下线
		Offline int
	}{
		Online:  0,
		Offline: 1,
	}

	// 用户类型
	UserTypes = struct {
		// 0 - 认证用户
		UserAuthed int
		// 2 - 游客
		Guest int
	}{
		UserAuthed: 0,
		Guest:      2,
	}
)

Functions

func ConsumerFunc added in v0.1.3

func ConsumerFunc(c *auth.Client, batchSize, rate int) func([][]byte) error

Types

type LoginOutEvent

type LoginOutEvent struct {
	Num          int    `json:"no"`
	SessionID    string `json:"si"`
	BehaviorType int    `json:"bt"`
	Timestamp    int64  `json:"ot"`
	UserType     int    `json:"ct"`
	DeviceID     string `json:"di"`
	PlayerID     string `json:"pi"`
}

func NewLoginEvent added in v0.1.2

func NewLoginEvent(si string, ts time.Time, userType int, deviceId, playerId string) LoginOutEvent

func NewLogoutEvent added in v0.1.2

func NewLogoutEvent(si string, ts time.Time, userType int, deviceId, playerId string) LoginOutEvent

type LoginOutRequest

type LoginOutRequest struct {
	Collections []LoginOutEvent `json:"collections"`
}

func DecodeLoginOutRequest added in v0.1.3

func DecodeLoginOutRequest(msgList [][]byte, batchSize int) ([]*LoginOutRequest, error)

func (*LoginOutRequest) Do

func (req *LoginOutRequest) Do(c *auth.Client, _url ...string) (*LoginOutResponse, error)

func (*LoginOutRequest) DoTestSuite

func (req *LoginOutRequest) DoTestSuite(c *auth.Client, testCode string) (*LoginOutResponse, error)

type LoginOutResponse

type LoginOutResponse struct {
	ErrCode int    `json:"errcode"`
	ErrMsg  string `json:"errmsg"`
	Data    struct {
		Results []LoginOutResult `json:"results"`
	} `json:"data"`
}

func (*LoginOutResponse) CanRetry added in v0.1.3

func (lor *LoginOutResponse) CanRetry() bool

func (*LoginOutResponse) IsOK added in v0.1.3

func (lor *LoginOutResponse) IsOK() bool

type LoginOutResult

type LoginOutResult struct {
	Num     int    `json:"no"`
	ErrCode int    `json:"errcode"`
	ErrMsg  string `json:"errmsg"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL