sessionkits

package
v0.0.0-...-986a728 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2017 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// SessionKey cookie name
	SessionKey string = "ZQSESSID"
	// SessionTime session有效期(单位:分钟), 默认7天
	SessionTimeout      int = 7 * 24 * 60
	SessionCookieDomain     = ""

	DefaultKey = "github.com/domego/ginkits/session"
)

Variables

This section is empty.

Functions

func GetSessionID

func GetSessionID(c *gin.Context) string

func NewRedisStore

func NewRedisStore(cfg *rediskits.RedisConfig) *redisStore

func SessionHandler

func SessionHandler(name string) gin.HandlerFunc

Types

type Session

type Session struct {
	ID string
	// contains filtered or unexported fields
}

func Default

func Default(c *gin.Context) *Session

func (*Session) Clear

func (s *Session) Clear(key string)

func (*Session) Get

func (s *Session) Get(key string) []byte

func (*Session) Set

func (s *Session) Set(key string, data []byte)

type SessionStorage

type SessionStorage interface {
	// SetSession set
	SetSession(sessionID string, key string, data []byte)
	// GetSession get
	GetSession(sessionID string, key string) []byte
	// ClearSession clear
	ClearSession(sessionID string, key string)
}

SessionStore

var Store SessionStorage

Jump to

Keyboard shortcuts

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