web_cookie

package
v0.0.0-...-872e689 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const CartKey = "cart:"
View Source
const PageCacheKey = "pageCache:"
View Source
const RecentlyLoginKey = "recentlyLogin"
View Source
const RecentlyLoginNum = 1000000
View Source
const Token2UserIdKey = "login"
View Source
const ViewedSetKey = "view:" // 客户看了哪些商品

Variables

This section is empty.

Functions

This section is empty.

Types

type Cookie struct {
	Client *redis.Client
}

func NewCookie

func NewCookie() *Cookie

func (*Cookie) AddToCart

func (cookie *Cookie) AddToCart(token string, itemId string, count int)

AddToCart: 加入到购物车

func (*Cookie) CheckToken

func (cookie *Cookie) CheckToken(token string) string

CheckToken: 尝试获取并返回令牌对应的用户Id

func (*Cookie) ClearSessionDaemon

func (cookie *Cookie) ClearSessionDaemon()

ClearSessionDaemon: daemon 运行, 用于清空session

func (*Cookie) PageCacheGet

func (cookie *Cookie) PageCacheGet(request string) string

PageCacheGet: 获取网页缓存

func (*Cookie) PageCacheSet

func (cookie *Cookie) PageCacheSet(request, page string)

PageCacheSet: 设置网页缓存

func (*Cookie) UpdateToken

func (cookie *Cookie) UpdateToken(token string, userId string, itemIds []string)

UpdateToken: 更新令牌

Jump to

Keyboard shortcuts

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