memory

package
v0.0.0-...-5342816 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2018 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Memory

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

Memory provides a session driver with 'memory' backend

func (*Memory) GC

func (m *Memory) GC() error

GC starts to garbage collection

func (*Memory) Get

func (m *Memory) Get(ctx context.Context, id string) (interface{}, error)

Get returns the session interface by the id TODO: the return interface is not designed, useless?

func (*Memory) GetCache

func (m *Memory) GetCache(ctx context.Context, id string) ([]byte, error)

GetCache gets the data from a session by its id TODO: id should be same with session id

func (*Memory) Init

func (m *Memory) Init(paras map[string]interface{}) error

Init creates two session maps

func (*Memory) New

func (m *Memory) New(ctx context.Context, id string) (string, error)

New creates a new session

func (*Memory) PutCache

func (m *Memory) PutCache(ctx context.Context, id string, data []byte) error

PutCache puts the data from a session by its id

func (*Memory) Release

func (m *Memory) Release(ctx context.Context, id string) error

Release frees the session data by its id

Jump to

Keyboard shortcuts

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