mirror of
https://github.com/crowdsecurity/crowdsec.git
synced 2025-05-11 12:25:53 +02:00
dependencies: replaced function calls to pkg/types, errors.Wrap (#2235)
we now use a generic pointer function, and slowly remove the deprecated pkg/errors
This commit is contained in:
parent
12c32d507c
commit
396dcf8e6e
16 changed files with 131 additions and 132 deletions
|
@ -20,15 +20,15 @@ import (
|
|||
"github.com/davecgh/go-spew/spew"
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
log "github.com/sirupsen/logrus"
|
||||
|
||||
"github.com/umahmood/haversine"
|
||||
"github.com/wasilibs/go-re2"
|
||||
|
||||
"github.com/crowdsecurity/go-cs-lib/pkg/ptr"
|
||||
|
||||
"github.com/crowdsecurity/crowdsec/pkg/cache"
|
||||
"github.com/crowdsecurity/crowdsec/pkg/database"
|
||||
"github.com/crowdsecurity/crowdsec/pkg/fflag"
|
||||
"github.com/crowdsecurity/crowdsec/pkg/types"
|
||||
|
||||
"github.com/wasilibs/go-re2"
|
||||
)
|
||||
|
||||
var dataFile map[string][]string
|
||||
|
@ -91,13 +91,13 @@ func RegexpCacheInit(filename string, CacheCfg types.DataSource) error {
|
|||
//cache is enabled
|
||||
|
||||
if CacheCfg.Size == nil {
|
||||
CacheCfg.Size = types.IntPtr(50)
|
||||
CacheCfg.Size = ptr.Of(50)
|
||||
}
|
||||
|
||||
gc := gcache.New(*CacheCfg.Size)
|
||||
|
||||
if CacheCfg.Strategy == nil {
|
||||
CacheCfg.Strategy = types.StrPtr("LRU")
|
||||
CacheCfg.Strategy = ptr.Of("LRU")
|
||||
}
|
||||
switch *CacheCfg.Strategy {
|
||||
case "LRU":
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue