store

package
v1.0.1-0...-cba1e01 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Marshal

func Marshal(value interface{}) ([]byte, error)

Marshal value to bytes using gob or ffjson.

func Unmarshal

func Unmarshal(buf []byte, value interface{}) error

Unmarshal bytes with gob or ffjson.

Types

type Item

type Item struct {
	Expiration time.Duration
	Object     interface{}
}

Item represents a item in the cache.

func (Item) Expired

func (item Item) Expired() bool

Expired returns true if the item has expired.

type RememberFunc

type RememberFunc func() interface{}

RememberFunc is the function that is used for remember method.

type Store

type Store interface {
	Flush() error
	//	Decrement(string, ...int64) (int64, error)
	Get(string) (interface{}, error)
	//	Number(string) (int64, error)
	//	Increment(string, ...int64) (int64, error)
	//	Remember(string, time.Duration, RememberFunc) (interface{}, error)
	Remove(string) error
	Result(string, interface{}) error
	Set(string, interface{}, time.Duration) error
	Close() error
}

Store provides a interface to implement cache stores.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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