gamelog

package
v1.3.21 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2025 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetOnlyWordProperty added in v1.3.18

func SetOnlyWordProperty(propertyNames ...string)

Types

type GameLog

type GameLog struct {
	Uid          string         // 唯一uid
	Event        string         // 事件名
	Property     map[string]any // 事件属性
	EventTimems  int64          // 时间戳毫秒级别
	EventTimeLoc string         // 带时区的本地时间字符串
}

todo 游戏日志对象

type SDK

type SDK struct {
	// contains filtered or unexported fields
}

func INIT

func INIT(config *SDKConfig) (*SDK, error)

func (*SDK) GetLogItem added in v1.3.17

func (sdk *SDK) GetLogItem(uid, event string, property map[string]any, timezone string, customEventTime ...time.Time) string

获取日志行

func (*SDK) Log

func (sdk *SDK) Log(uid, event string, property map[string]any, timezone string, customEventTime ...time.Time)

记录日志

func (*SDK) LogLtz

func (sdk *SDK) LogLtz(uid, event string, property map[string]any, customEventTime ...time.Time)

按服务器时区记录日志

func (*SDK) Shutdown

func (sdk *SDK) Shutdown()

优雅关闭

func (*SDK) Uinc added in v1.3.14

func (sdk *SDK) Uinc(uid string, property map[string]any, timezone string, customEventTime ...time.Time)

用户属性自增/减

func (*SDK) UincLtz added in v1.3.14

func (sdk *SDK) UincLtz(uid string, property map[string]any, customEventTime ...time.Time)

func (*SDK) Uinit added in v1.3.14

func (sdk *SDK) Uinit(uid string, property map[string]any, timezone string, customEventTime ...time.Time)

用户属性初始化

func (*SDK) UinitLtz added in v1.3.14

func (sdk *SDK) UinitLtz(uid string, property map[string]any, customEventTime ...time.Time)

func (*SDK) Uset added in v1.3.14

func (sdk *SDK) Uset(uid string, property map[string]any, timezone string, customEventTime ...time.Time)

用户属性设置

func (*SDK) UsetLtz added in v1.3.14

func (sdk *SDK) UsetLtz(uid string, property map[string]any, customEventTime ...time.Time)

func (*SDK) Uunset added in v1.3.14

func (sdk *SDK) Uunset(uid string, property map[string]any, timezone string, customEventTime ...time.Time)

用户属性删除

func (*SDK) UunsetLtz added in v1.3.14

func (sdk *SDK) UunsetLtz(uid string, property map[string]any, customEventTime ...time.Time)

type SDKConfig

type SDKConfig struct {
	// 配置变量
	Pid           string // 项目id
	BaseUrl       string // 日志服务器地址
	ReportSk      string // 上报解密key
	FlushInterval int    // 刷新间隔
	DiskBakPath   string // 磁盘备份路径
	RetryN        int    // 每N次重试
	ChanSize      int    // 信道大小, 默认1000

	SendSaveType int // 发送存储类型, 默认不设置为0代表文件存储, 1代表走kafka可实同步日志
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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