cache

package
v0.0.0-...-8fead6e Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2019 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Overview

Package cache is used to store the alerts parser state into Redis.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache interface {
	PutState(s *alerts.State) error
	GetState() (alerts.State, error)
}

Cache is the general interface all cache providers must implement.

type RedisCache

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

RedisCache represents a cache that is based on a underlying Redis.

func NewRedisCache

func NewRedisCache(r *redis.Client, key string) (RedisCache, error)

NewRedisCache constructs and returns a new RedisCache.

func (*RedisCache) GetState

func (r *RedisCache) GetState() (alerts.State, error)

GetState gets the state from Redis.

func (*RedisCache) PutState

func (r *RedisCache) PutState(s *alerts.State) error

PutState saves the state into Redis.

Jump to

Keyboard shortcuts

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