memory

package
Version: v3.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2017 License: MIT Imports: 3 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Engine

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

Engine is the default memory storage engine

func NewMemoryStore

func NewMemoryStore(expirePoll time.Duration) *Engine

NewMemoryStore creates a new standard in memory store

func (*Engine) Exists

func (e *Engine) Exists(key string) bool

Exists checks to see if a key exists in the store

func (*Engine) Expire

func (e *Engine) Expire(key string) error

Expire marks the key as expired, and removes it from the storage engine

func (*Engine) Get

func (e *Engine) Get(key string) (data []byte, err error)

Get retrieves data from the store based on key, if it exists, else it returns an error

func (*Engine) IsExpired

func (e *Engine) IsExpired(key string) bool

IsExpired checks to see if the key has expired

func (*Engine) IsLocked

func (e *Engine) IsLocked(key string) bool

IsLocked checks to see if the key has been locked

func (*Engine) Lock

func (e *Engine) Lock(key string) error

Lock sets a lock against the given key

func (*Engine) Put

func (e *Engine) Put(key string, data []byte, expiry time.Time) error

Put stores data against a key, else it returns an error

func (*Engine) Unlock

func (e *Engine) Unlock(key string) error

Unlock removes the lock from a given key, if it doesn't exist it returns an error

Source Files

Jump to

Keyboard shortcuts

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