util

package
v0.0.0-...-e3b2c35 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SessionStore

type SessionStore struct {
	Client *memcache.Client
}

func (*SessionStore) CreateSSClient

func (c *SessionStore) CreateSSClient(host string)

CreateSSClient use for creating memcache.Client

func (*SessionStore) GetSession

func (c *SessionStore) GetSession(uid string) (*UserSession, error)

GetSession use for getting UserSession by its UserSession.UID

func (*SessionStore) SetSession

func (c *SessionStore) SetSession(us *UserSession) bool

SetSession use for caching UserSession in memory

type UserSession

type UserSession struct {
	ID     int       `json:"id"`
	UID    string    `json:"uid"`
	Expire time.Time `json:"expire"`
}

Jump to

Keyboard shortcuts

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