session

package
v0.0.0-...-df226ee Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var UserList = make([]*User, 0)
View Source
var UserMap = &sync.Map{}

Functions

func Login

func Login(c echo.Context) error

func Logout

func Logout(c echo.Context) error

Types

type LoginModel

type LoginModel struct {
	UserID   string `json:"userid"`
	Password string `json:"password"`
}

type Session

type Session struct {
	Token      string `json:"token"`
	User       *User  `json:"user"`
	CreateTime time.Time
}

type User

type User struct {
	ID        string `json:"id"`
	Name      string `json:"name"`
	AvatarURL string `json:"avatarUrl"`
	Email     string `json:"email"`
	Mobile    string `json:"mobile"`
	Priv      string `json:"priv"`
}

func GetUser

func GetUser(c echo.Context) *User

Jump to

Keyboard shortcuts

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