redis

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Sessions

type Sessions struct {
	Namespace string
	// contains filtered or unexported fields
}

Sessions implements sessions interface for server.Connects

func New

func New(cl *redis.Client) *Sessions

New returns new Redis session controller, it takes created redis connect Don't forget register your session type RegisterSessionType()

func (*Sessions) ErrorLog

func (s *Sessions) ErrorLog(format string, v ...interface{})

ErrorLog prints error to log with Redis prefix

func (*Sessions) Get

func (s *Sessions) Get(key string) (interface{}, error)

Get returns value in the storage

func (*Sessions) KeyExists

func (s *Sessions) KeyExists(key string) bool

KeyExists returns true if key exists in the Storage returns false when request end with error

func (*Sessions) RegisterSessionType

func (s *Sessions) RegisterSessionType(val interface{})

RegisterSessionType records a type of the session data

func (*Sessions) RemoveKeys

func (s *Sessions) RemoveKeys(keys ...string)

RemoveKeys removes any keys

func (*Sessions) Set

func (s *Sessions) Set(key string, val interface{}) error

Set sets value with key

Jump to

Keyboard shortcuts

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