model

package
v1.0.34 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2022 License: MIT Imports: 10 Imported by: 1

Documentation

Overview

Package model @Description:

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddUser

func AddUser(user *User) error

AddUser *

  • @Description:
  • @param user
  • @return error

func DeleteUser

func DeleteUser(uid string) error

DeleteUser

@Description:
* @param uid
* @return error

func SearchAnswer added in v1.0.34

func SearchAnswer(title string) string

func SetPush

func SetPush(push func(id, kind, message string))

func TokenToCookies

func TokenToCookies(token string) []*http.Cookie

func UpdateUser

func UpdateUser(user *User) error

UpdateUser *

  • @Description:
  • @param user
  • @return error

func UserCount

func UserCount(uid string) int

UserCount *

  • @Description:
  • @param uid
  • @return int

Types

type User

type User struct {
	Nick      string `json:"nick"`
	UID       string `json:"uid"`
	Token     string `json:"token"`
	LoginTime int64  `json:"login_time"`
	PushId    string `json:"push_id"`
	Status    int    `json:"status"`
}

User *

  • @Description:

func Find

func Find(uid string) *User

Find *

  • @Description:
  • @param uid
  • @return *User

func Query

func Query() ([]*User, error)

Query *

  • @Description: 查询所有未掉线的用户
  • @return []*User
  • @return error

func QueryByPushID

func QueryByPushID(pushID string) ([]*User, error)

QueryByPushID *

  • @Description: 根据推送平台的key查询用户
  • @return []*User
  • @return error

func QueryFailUser added in v1.0.33

func QueryFailUser() ([]*User, error)

func (*User) ToBrowserCookies

func (u *User) ToBrowserCookies() []playwright.BrowserContextAddCookiesOptionsCookies

func (*User) ToCookies

func (u *User) ToCookies() []*http.Cookie

ToCookies *

  • @Description: 获取user的cookie
  • @receiver u
  • @return []*http.Cookie

Jump to

Keyboard shortcuts

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