hybrid

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2024 License: MIT Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrLocalCacheIsNotInitialised = errors.New("local cache is not initialised")
)

Functions

This section is empty.

Types

type HybridCacher

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

func NewHybridCacher

func NewHybridCacher(config HybridOptions) (*HybridCacher, error)

func (*HybridCacher) Bytes

func (c *HybridCacher) Bytes(
	ctx context.Context,
	key string,
) (bytes []byte, err error)

func (*HybridCacher) BytesMany

func (c *HybridCacher) BytesMany(ctx context.Context, keys ...string) (result map[string][]byte, err error)

BytesMany implements cache.Cacher

func (*HybridCacher) Close

func (c *HybridCacher) Close() error

Close implements cache.Cacher

func (*HybridCacher) Delete

func (c *HybridCacher) Delete(
	ctx context.Context,
	key string,
) error

Delete implements cache.Cacher

func (*HybridCacher) DeleteMany

func (c *HybridCacher) DeleteMany(ctx context.Context, keys ...string) (err error)

DeleteMany implements cache.Cacher

func (*HybridCacher) Errors

func (c *HybridCacher) Errors() <-chan error

func (*HybridCacher) Exists

func (c *HybridCacher) Exists(
	ctx context.Context,
	key string,
) (bool, error)

Exists implements cache.Cacher

func (*HybridCacher) Identity

func (c *HybridCacher) Identity() uuid.UUID

func (*HybridCacher) Local

func (c *HybridCacher) Local() cache.Cacher

func (*HybridCacher) Redis

func (c *HybridCacher) Redis() *redis.RedisCacher

func (*HybridCacher) Set

func (c *HybridCacher) Set(
	ctx context.Context,
	key string,
	bytes []byte,
	duration time.Duration,
) error

Set implements cache.Cacher

func (*HybridCacher) SetMany

func (c *HybridCacher) SetMany(ctx context.Context, items map[string][]byte) (err error)

SetMany implements cache.Cacher

func (*HybridCacher) SetManyExp

func (c *HybridCacher) SetManyExp(ctx context.Context, items map[string][]byte, duration time.Duration) (err error)

SetManyExp implements cache.Cacher

type HybridEvictCallback

type HybridEvictCallback func(keys ...string)

type HybridOptions

type HybridOptions struct {
	Topic         string
	RedisCacher   *redis.RedisCacher
	LocalCache    cache.Cacher
	EvictCallback HybridEvictCallback
}

Jump to

Keyboard shortcuts

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