dataaccess

package
v0.0.0-...-3feb4d9 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DataAccces

type DataAccces interface {
	GetNote(ctx context.Context, key string) (data []byte, found bool, err error)
	GetVersion(ctx context.Context, key string) (version string, err error)
	SetNote(ctx context.Context, key string, data []byte) (version string, err error)
}

DataAccces Data Access Interface.

type InMemory

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

InMemory implements the DataAccces interface using bigcache.

func NewInMemory

func NewInMemory(ttl, maxEntrySize, hardMaxCacheSize int, verbose bool) (*InMemory, error)

func (InMemory) GetNote

func (mem InMemory) GetNote(ctx context.Context, key string) (data []byte, found bool, err error)

func (InMemory) GetVersion

func (mem InMemory) GetVersion(ctx context.Context, key string) (version string, err error)

func (InMemory) SetNote

func (mem InMemory) SetNote(ctx context.Context, key string, data []byte) (version string, err error)

type Redis

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

func NewRedis

func NewRedis(pool *redis.Pool, ttl int) *Redis

func (Redis) GetNote

func (r Redis) GetNote(ctx context.Context, key string) (data []byte, found bool, _ error)

func (Redis) GetVersion

func (r Redis) GetVersion(ctx context.Context, key string) (version string, err error)

func (Redis) SetNote

func (r Redis) SetNote(ctx context.Context, key string, data []byte) (version string, err error)

Jump to

Keyboard shortcuts

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