support for regexps result cache (#2104)

* support for regexps result cache : gcache + xxhash

Co-authored-by: Marco Mariani <marco@crowdsec.net>
This commit is contained in:
Thibault "bui" Koechlin 2023-03-08 16:07:49 +01:00 committed by GitHub
parent e71d146a2d
commit 5b0fe4b7f1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 173 additions and 53 deletions

6
pkg/cache/cache.go vendored
View file

@ -4,10 +4,10 @@ import (
"time"
"github.com/bluele/gcache"
"github.com/crowdsecurity/crowdsec/pkg/types"
"github.com/prometheus/client_golang/prometheus"
"github.com/sirupsen/logrus"
log "github.com/sirupsen/logrus"
"github.com/crowdsecurity/crowdsec/pkg/types"
)
var Caches []gcache.Cache
@ -52,7 +52,7 @@ func CacheInit(cfg CacheCfg) error {
cfg.LogLevel = new(log.Level)
*cfg.LogLevel = log.InfoLevel
}
var clog = logrus.New()
var clog = log.New()
if err := types.ConfigureLogger(clog); err != nil {
log.Fatalf("While creating cache logger : %s", err)
}