Versions in this module Expand all Collapse all v1 v1.0.1 Mar 17, 2026 v1.0.0 Mar 11, 2026 Changes in this version + func CreateUser(openId string, socketUrl string, logHandler func(format string, a ...any), ...) user_data.User + type CmdAction struct + type RpcTimeout struct + type User struct + AccessToken string + Closed atomic.Bool + HasGetInfo bool + HeartbeatInterval time.Duration + LastPingTime time.Time + LoginCode string + Logined bool + OpenId string + UserId uint64 + ZoneId uint32 + func NewUser(openId string, conn *websocket.Conn, ...) *User + func (u *User) AddOnClosedHandler(f func(user user_data.User)) + func (u *User) IsLogin() bool + func (u *User) Logout() + func (u *User) ReleaseActionGuard() + func (u *User) TakeActionGuard() + func (user *User) AllocSequence() uint64 + func (user *User) AwaitReceiveHandlerClose() + func (user *User) Close() + func (user *User) GetAccessToken() string + func (user *User) GetExtralData(key string) any + func (user *User) GetLoginCode() string + func (user *User) GetLogined() bool + func (user *User) GetOpenId() string + func (user *User) GetUserId() uint64 + func (user *User) GetZoneId() uint32 + func (user *User) InitHeartbeatFunc(f func(user_data.User) error) + func (user *User) Log(format string, a ...any) + func (user *User) ReceiveHandler(unpack user_data.UserReceiveUnpackFunc, ...) + func (user *User) RegisterMessageHandler(rpcName string, f func(*user_data.TaskActionUser, proto.Message, int32) error) + func (user *User) RunTask(timeout time.Duration, f func(*user_data.TaskActionUser) error, name string) *user_data.TaskActionUser + func (user *User) RunTaskDefaultTimeout(f func(*user_data.TaskActionUser) error, name string) *user_data.TaskActionUser + func (user *User) SendReq(action *user_data.TaskActionUser, csMsg proto.Message, csHead proto.Message, ...) (int32, proto.Message, error) + func (user *User) SetExtralData(key string, value any) + func (user *User) SetHasGetInfo(d bool) + func (user *User) SetHeartbeatInterval(d time.Duration) + func (user *User) SetLastPingTime(d time.Time) + func (user *User) SetLoginCode(d string) + func (user *User) SetLogined(d bool) + func (user *User) SetUserId(d uint64) + func (user *User) SetZoneId(d uint32)