redisprovider

package module
v0.0.0-...-746feee Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

README

redisprovider

A session provider using redis for flygo

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(options *redis.Options) flygo.SessionProvider

Get new SessionProvider

func NewSession

func NewSession(client *redis.Client, id, key string) flygo.Session

New session

func NewWithPrefixKey

func NewWithPrefixKey(options *redis.Options, prefixKey string) flygo.SessionProvider

Get new SessionProvider with prefix key

Types

type RedisSession

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

Define RedisSession Struct

func (*RedisSession) Clear

func (r *RedisSession) Clear()

Clear all data

func (*RedisSession) Del

func (r *RedisSession) Del(name string)

Del data

func (*RedisSession) Get

func (r *RedisSession) Get(name string) interface{}

Get data

func (*RedisSession) GetAll

func (r *RedisSession) GetAll() map[string]interface{}

Get all data

func (*RedisSession) Id

func (r *RedisSession) Id() string

Get session Id

func (*RedisSession) Invalidate

func (r *RedisSession) Invalidate()

Invalidate

func (*RedisSession) Invalidated

func (r *RedisSession) Invalidated() bool

func (*RedisSession) Renew

func (r *RedisSession) Renew(lifeTime time.Duration)

Renew session

func (*RedisSession) Set

func (r *RedisSession) Set(name string, val interface{})

Set data

func (*RedisSession) SetAll

func (r *RedisSession) SetAll(data map[string]interface{}, flush bool)

Set all data

type SessionProvider

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

Define CookieSessionProvider struct

func (*SessionProvider) Clear

func (sp *SessionProvider) Clear()

Clear all sessions

func (*SessionProvider) Del

func (sp *SessionProvider) Del(id string)

Del session by id

func (*SessionProvider) Exists

func (sp *SessionProvider) Exists(id string) bool

Session is Exists?

func (*SessionProvider) Get

func (sp *SessionProvider) Get(id string) flygo.Session

Get session by id

func (*SessionProvider) GetAll

func (sp *SessionProvider) GetAll() map[string]flygo.Session

Get all sessions

func (*SessionProvider) GetId

func (sp *SessionProvider) GetId(r *http.Request) string

Get session id from client

func (*SessionProvider) New

func (sp *SessionProvider) New(config *flygo.SessionConfig) flygo.Session

New session by this provider

func (*SessionProvider) Refresh

func (sp *SessionProvider) Refresh(session flygo.Session, config *flygo.SessionConfig)

Refresh session by this provider

Jump to

Keyboard shortcuts

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