diff --git a/pkg/meta/boltdb/boltdb.go b/pkg/meta/boltdb/boltdb.go index ca14e456da..38394eb402 100644 --- a/pkg/meta/boltdb/boltdb.go +++ b/pkg/meta/boltdb/boltdb.go @@ -2,12 +2,13 @@ package boltdb import ( "context" - "encoding/json" "errors" "fmt" "strings" "time" + jsoniter "github.com/json-iterator/go" + godigest "github.com/opencontainers/go-digest" ispec "github.com/opencontainers/image-spec/specs-go/v1" "go.etcd.io/bbolt" @@ -29,6 +30,8 @@ type BoltDB struct { Log log.Logger } +var json = jsoniter.ConfigCompatibleWithStandardLibrary + func New(boltDB *bbolt.DB, log log.Logger) (*BoltDB, error) { err := boltDB.Update(func(transaction *bbolt.Tx) error { versionBuck, err := transaction.CreateBucketIfNotExists([]byte(VersionBucket)) diff --git a/pkg/meta/dynamodb/dynamodb.go b/pkg/meta/dynamodb/dynamodb.go index d96c2b1dfa..b5f62a4a41 100644 --- a/pkg/meta/dynamodb/dynamodb.go +++ b/pkg/meta/dynamodb/dynamodb.go @@ -2,12 +2,13 @@ package dynamodb import ( "context" - "encoding/json" "errors" "fmt" "strings" "time" + jsoniter "github.com/json-iterator/go" + "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/feature/dynamodb/attributevalue" "github.com/aws/aws-sdk-go-v2/service/dynamodb" @@ -25,6 +26,8 @@ import ( reqCtx "zotregistry.io/zot/pkg/requestcontext" ) +var json = jsoniter.ConfigCompatibleWithStandardLibrary + var errMetaDB = errors.New("metadb: error while constructing manifest meta") type DynamoDB struct {