cache

package
v0.0.0-...-5a03b40 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package cache implements integrations with Redis.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

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

Cache wraps the functionality of our redis client.

func New

func New(purgeryID string, pool *redis.Pool) *Cache

New initializes and returns a new Cache, for the given ID, which works on the given Conn.

func (*Cache) Close

func (c *Cache) Close() error

Close closes the underlying Cache connection pool.

func (*Cache) EnqueuePurgeRequest

func (c *Cache) EnqueuePurgeRequest(logger *zap.Logger, url string) bool

EnqueuePurgeRequest enqueues a purge request for the given URL.

func (*Cache) Next

func (c *Cache) Next(logger *zap.Logger) (cp, url string, ok bool)

Next returns the next url to be purged or empty strings in case such a URL does not exist yet.

func (*Cache) Ping

func (c *Cache) Ping(logger *zap.Logger) bool

Ping pings the Redis instance the Cache is configured to connect to.

func (*Cache) Store

func (c *Cache) Store(logger *zap.Logger, checkpoint string) bool

Store saves the given value as the Cache's checkpoint.

Jump to

Keyboard shortcuts

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