redis

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 17, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*Provider)

Option configure provider.

func WithMarshal

func WithMarshal(marshal encoding.Marshal, unmarshal encoding.Unmarshal) Option

WithMarshal sets marshal and unmarshal.

type Provider

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

Provider redis provider.

func New

func New(pool func(context.Context) (redigo.Conn, error), opts ...Option) *Provider

New creates new provider.

func (*Provider) Delete

func (c *Provider) Delete(ctx context.Context, item *cache.Item) error

Delete by key.

func (*Provider) Get

func (c *Provider) Get(ctx context.Context, item *cache.Item) error

Get by key unmarhal to data return ttl.

func (*Provider) Set

func (c *Provider) Set(ctx context.Context, item *cache.Item) error

Set sets item to cache.

func (*Provider) String

func (c *Provider) String() string

String gets name.

Jump to

Keyboard shortcuts

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