session

package
v2.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Session

func Session(conf *Config) func(*koa.Context, koa.Next)

Session func

Types

type Config

type Config struct {
	Name       string
	Store      Store
	Path       string    // optional
	Domain     string    // optional
	Expires    time.Time // optional
	RawExpires string    // for reading cookies only
	MaxAge     int
	Secure     bool
	HttpOnly   bool
	SameSite   http.SameSite
	Raw        string
	Unparsed   []string // Raw text of unparsed attribute-value pairs
}

Config struct

type KoaSession

type KoaSession struct {
	Config
	// contains filtered or unexported fields
}

KoaSession struct

type MemInfo

type MemInfo struct {
	// contains filtered or unexported fields
}

MemInfo struct

type MemStore

type MemStore struct {
	// contains filtered or unexported fields
}

MemStore struct

func NewMemStore

func NewMemStore() *MemStore

NewMemStore func

func (*MemStore) Get

func (store *MemStore) Get(key string) (map[string]interface{}, error)

Get func

func (*MemStore) Save

func (store *MemStore) Save(key string, value map[string]interface{}, second time.Duration) error

Save func

type RedisStore

type RedisStore struct {
	// contains filtered or unexported fields
}

RedisStore struct

func NewRedisStore

func NewRedisStore(rds redis.UniversalClient) *RedisStore

NewRedisStore func

func (*RedisStore) Get

func (store *RedisStore) Get(key string) (map[string]interface{}, error)

Get func

func (*RedisStore) Save

func (store *RedisStore) Save(key string, value map[string]interface{}, second time.Duration) error

Save func

type Store

type Store interface {
	Save(key string, value map[string]interface{}, second time.Duration) error
	Get(key string) (map[string]interface{}, error)
}

Store interface

Jump to

Keyboard shortcuts

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