sdsession

package
v0.0.0-...-03eec91 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2019 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const AuthUrl = "/oauth2/github/login"

Variables

View Source
var Redis_Prefix = "sundog:sessions:"
View Source
var Redis_life = time.Hour
View Source
var SessionDrivers = make(map[string]Store)

定义驱动列表

Functions

func GetSession

func GetSession(c *gin.Context) (s *session)

func Middleware

func Middleware(config string) gin.HandlerFunc

func Register

func Register(name string, store Store)

驱动注册器

func SessionStart

func SessionStart(config string, r *http.Request, w gin.ResponseWriter) *session

Types

type SessionConfig

type SessionConfig struct {
	CookieName      string `json:"cookieName"`
	EnableSetCookie bool   `json:"enableSetCookie,omitempty"`
	Secure          bool   `json:"secure"`
	CookieLifeTime  int    `json:"cookieLifeTime"`
	Domain          string `json:"domain"`
	StoreDriver     string `json:"storeDriver"`
}

type Store

type Store interface {
	Get(k string, sid string) interface{}
	Set(k string, v interface{}, sid string) error
}

定义session保存接口

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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