memory

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewConn

func NewConn() redis.Conn

NewConn create redis connection

Types

type MockToken

type MockToken struct{}

MockToken is the Tocken moct struct

func (MockToken) Close

func (m MockToken) Close(r *redigomock.Conn)

Close is the redis connection wrapper

func (MockToken) GetValue

func (m MockToken) GetValue(r *redigomock.Conn, name string) bool

GetValue mocks a redis GET

func (MockToken) SetValue

func (m MockToken) SetValue(r *redigomock.Conn, name, value string) interface{}

SetValue mocks a redis SET

type Token

type Token struct{}

Token is the session key

func (Token) Close

func (t Token) Close(conn redis.Conn)

Close redis

func (Token) GetValue

func (t Token) GetValue(conn redis.Conn, value string) bool

GetValue retrieves value from memory

func (Token) SetValue

func (t Token) SetValue(conn redis.Conn, name, value string) interface{}

SetValue store value in memory

type Valuer

type Valuer interface {
	SetValue(redis.Conn, string, string) interface{}
	GetValue(redis.Conn, string, string) interface{}
	Close(redis.Conn)
}

Valuer defines methods of value CRUD

Jump to

Keyboard shortcuts

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