memory

package
v0.18.1 Latest Latest
Warning

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

Go to latest
Published: May 18, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrPayloadNotFound = errors.New("payload not found")
)

Functions

This section is empty.

Types

type Memorer

type Memorer interface {
	Set(ctx context.Context, key string, payload Payloader, duration time.Duration) error
	Get(ctx context.Context, key string, payload Payloader) error
	Del(ctx context.Context, key string) error
}

func New

func New(cfg *redis.Options) Memorer

type Memory

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

func (*Memory) Del

func (m *Memory) Del(ctx context.Context, key string) error

func (*Memory) Get

func (m *Memory) Get(ctx context.Context, key string, payload Payloader) error

func (*Memory) Set

func (m *Memory) Set(ctx context.Context, key string, payload Payloader, duration time.Duration) error

type Payloader

type Payloader interface {
	MarshalBinary() ([]byte, error)
	UnmarshalBinary(data []byte) error
}

Jump to

Keyboard shortcuts

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