freesia

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2019 License: MIT Imports: 10 Imported by: 0

README

Freesia

Freesia is a multilevel cache backed by redis and roc.

Feature

  • Customize codec
  • Using Redis subscription to delete cache asynchronously.

Usage

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Error

type Error string

func (Error) Error

func (e Error) Error() string

type Freesia

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

func New

func New(store Store, setters ...Setter) (*Freesia, error)

func (*Freesia) Del

func (f *Freesia) Del(keys ...string) error

func (*Freesia) Get

func (f *Freesia) Get(e *entry.Entry) error

func (*Freesia) MGet

func (f *Freesia) MGet(es ...*entry.Entry) ([]*entry.Entry, error)

func (*Freesia) MSet

func (f *Freesia) MSet(es ...*entry.Entry) error

func (*Freesia) Pub

func (f *Freesia) Pub(keys ...string) error

func (*Freesia) Set

func (f *Freesia) Set(e *entry.Entry) error

type Setter

type Setter func(f *Freesia) error

type Store

type Store interface {
	Set(key string, value interface{}, expiration time.Duration) *redis.StatusCmd
	MSet(pairs ...interface{}) *redis.StatusCmd
	Get(key string) *redis.StringCmd
	MGet(keys ...string) *redis.SliceCmd
	Del(keys ...string) *redis.IntCmd
	Pipeline() redis.Pipeliner
	Subscribe(channels ...string) *redis.PubSub
	Publish(channel string, message interface{}) *redis.IntCmd
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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