models

package
v0.0.0-...-f30c268 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddSession

func AddSession(c *gin.Context, rt string, user *User) error

func AddUser

func AddUser(user *User) (int64, error)

func VerifyUser

func VerifyUser(user, dbuser *User) bool

Types

type Session

type Session struct {
	Id           int64     `json:"-"`
	UserId       int64     `json:"uid"`
	RefreshToken string    `json:"refreshToken"`
	UserAgent    string    `json:"ua"`
	FingerPrint  string    `json:"fingerprint"`
	Ip           string    `json:"ip"`
	ExpiresAt    time.Time `json:"expiresAt"`
	CreatedAt    time.Time `json:"createdAt"`
}

func GetSessionByRT

func GetSessionByRT(ctx context.Context, rt string) (*Session, error)

type User

type User struct {
	Id       int64
	User     string `form:"user" json:"user" xml:"user"  binding:"required"`
	Password string `form:"password" json:"password" xml:"password" binding:"required"`
	Email    string `form:"email" json:"email" xml:"email"`
}

func GetUserById

func GetUserById(uid int64) (*User, error)

Jump to

Keyboard shortcuts

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