func (c *Cache) GetDOT(repo string, cluster bool) (string, error) {
	return c.hget(dotHash, repoKey(repo, cluster))
}
GetDOT gets a DOT for a repo.
package cache
import (
	"fmt"
	"github.com/go-redis/redis/v7"
	log "github.com/sirupsen/logrus"
)
type Cache struct {
	client *redis.Client
	log    *log.Entry
}
const (
	dotHash = "dot"
	svgHash = "svg"
	repoScores = "reposcores"
)
func New(addr string) (*Cache, error) {
	client := redis.NewClient(&redis.Options{
		Addr: addr,
	})
	_, err := client.Ping().Result()
	if err != nil {
		return nil, err
	}
	log := log.WithFields(
		log.Fields{
			"cache": addr,
		},
	)
	registerGauges(client)
	log.Infof("Cache initialized")
	return &Cache{
		client: client,
		log:    log,
	}, nil
}
func (c *Cache) Clear(repo string) error {
	var rerr error
	_, err := c.hdel(dotHash, repoKey(repo, false))
	if err != nil && rerr == nil {
		rerr = err
	}
	_, err = c.hdel(dotHash, repoKey(repo, true))
	if err != nil && rerr == nil {
		rerr = err
	}
	_, err = c.hdel(svgHash, repoKey(repo, false))
	if err != nil && rerr == nil {
		rerr = err
	}
	_, err = c.hdel(svgHash, repoKey(repo, true))
	if err != nil && rerr == nil {
		rerr = err
	}
	return rerr
}
func (c *Cache) SetSVG(repo string, cluster bool, svg string) {
	if err := c.hset(svgHash, repoKey(repo, cluster), svg); err != nil {
		c.log.Errorf("SetSVG failed: %s", err)
	}
}
func (c *Cache) GetSVG(repo string, cluster bool) (string, error) {
	return c.hget(svgHash, repoKey(repo, cluster))
}
func (c *Cache) SetDOT(repo string, cluster bool, dot string) {
	if err := c.hset(dotHash, repoKey(repo, cluster), dot); err != nil {
		c.log.Errorf("SetDOT failed: %s", err)
	}
}