session

package module
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckLogin

func CheckLogin(tokenValue string) (string, error)

func GetSessionValue

func GetSessionValue(tokenValue string, key string) (any, error)

func Login

func Login(model model.LoginModel) (string, error)

func Logout

func Logout(token string) error

func LogoutByLoginId

func LogoutByLoginId(loginId any) error

func RegisterListener

func RegisterListener(listener Listener)

func RenewTimeout

func RenewTimeout(loginId any, token string) error

func SetSessionValue

func SetSessionValue(tokenValue string, key string, value any) error

Types

type Listener

type Listener interface {
	// DoLogin 每次登录时触发
	DoLogin(loginId any, tokenValue string, loginModel model.LoginModel)

	// DoLogout 每次注销时触发
	DoLogout(tokenValue string)

	// DoLogoutByLoginId 每次注销时触发
	DoLogoutByLoginId(loginId any)

	//DoRenewTimeout 每次Token续期时触发
	DoRenewTimeout(tokenValue string, loginId any, timout int64)
}

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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