sessions

package
v0.0.0-...-a0faf1b Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2019 License: MIT Imports: 7 Imported by: 1

Documentation

Index

Constants

View Source
const (
	DefaultKey = "github.com/jlytwhx/yellowDuck"
)

Variables

This section is empty.

Functions

func SessionMiddleware

func SessionMiddleware(name string, store Store) gin.HandlerFunc

func SessionsManyMiddleware

func SessionsManyMiddleware(names []string, store Store) gin.HandlerFunc

Types

type Key

type Key struct {
	Data            interface{}
	ExpireTimeStamp int64
}

type Options

type Options struct {
	Path     string
	Domain   string
	MaxAge   int
	Secure   bool
	HttpOnly bool
}

type Session

type Session interface {
	// Get returns the sessions value associated to the given key.
	Get(key interface{}) interface{}
	// Set sets the sessions value associated to the given key.
	Set(key interface{}, val interface{}, expire int)
	// Delete removes the sessions value associated to the given key.
	Delete(key interface{})
	// Clear deletes all values in the sessions.
	Clear()
	// Options sets configuration for a sessions.
	Options(Options)
	// Save saves all sessions used during the current request.
	Save() error
}

func Default

func Default(c *gin.Context) Session

type Store

type Store interface {
	sessions.Store
	Options(Options)
}

Directories

Path Synopsis
driver

Jump to

Keyboard shortcuts

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