session

package
v1.3.10 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Session

func Session(conf SessionConf, store Store) func(*koa.Context, koa.Next)

Session func

Types

type KoaSession

type KoaSession struct {
	Store      Store
	CookieConf SessionConf
}

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 SessionConf added in v1.3.5

type SessionConf struct {
	Name     string
	Path     string
	Domain   string
	MaxAge   int
	Secure   bool
	HttpOnly bool
	SameSite http.SameSite
}

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