From fd56bd28daaf4c837668a04d9c875caa75f8b2d8 Mon Sep 17 00:00:00 2001 From: Fenny <25108519+Fenny@users.noreply.github.com> Date: Wed, 18 Nov 2020 09:00:59 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=AD=20stay=20backwards=20compatible?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- badger/badger.go | 1 + dynamodb/dynamodb.go | 1 + memcache/memcache.go | 1 + memory/memory.go | 1 + mongodb/mongodb.go | 1 + mysql/mysql.go | 1 + postgres/postgres.go | 2 +- redis/redis.go | 1 + sqlite3/sqlite3.go | 1 + 9 files changed, 9 insertions(+), 1 deletion(-) diff --git a/badger/badger.go b/badger/badger.go index c0dbdcb2..839b54be 100644 --- a/badger/badger.go +++ b/badger/badger.go @@ -18,6 +18,7 @@ type Storage struct { // ErrNotFound means that a get call did not find the requested key. var ErrNotFound = errors.New("key not found") +var ErrKeyNotExist = ErrNotFound // New creates a new memory storage func New(config ...Config) *Storage { diff --git a/dynamodb/dynamodb.go b/dynamodb/dynamodb.go index 0692938a..8ab98ab2 100644 --- a/dynamodb/dynamodb.go +++ b/dynamodb/dynamodb.go @@ -21,6 +21,7 @@ type Storage struct { // ErrNotFound means that a get call did not find the requested key. var ErrNotFound = errors.New("key not found") +var ErrKeyNotExist = ErrNotFound // New creates a new storage func New(config Config) *Storage { diff --git a/memcache/memcache.go b/memcache/memcache.go index a30d7163..184992f3 100644 --- a/memcache/memcache.go +++ b/memcache/memcache.go @@ -19,6 +19,7 @@ type Storage struct { // ErrNotFound means that a get call did not find the requested key. var ErrNotFound = errors.New("key not found") +var ErrKeyNotExist = ErrNotFound // New creates a new storage func New(config ...Config) *Storage { diff --git a/memory/memory.go b/memory/memory.go index 7c434fd3..f4c118d9 100644 --- a/memory/memory.go +++ b/memory/memory.go @@ -17,6 +17,7 @@ type Storage struct { // ErrNotFound means that a get call did not find the requested key. var ErrNotFound = errors.New("key not found") +var ErrKeyNotExist = ErrNotFound type entry struct { data []byte diff --git a/mongodb/mongodb.go b/mongodb/mongodb.go index 398f4552..ee89e5f2 100644 --- a/mongodb/mongodb.go +++ b/mongodb/mongodb.go @@ -24,6 +24,7 @@ type Storage struct { // ErrNotFound means that a get call did not find the requested key. var ErrNotFound = errors.New("key not found") +var ErrKeyNotExist = ErrNotFound type item struct { ObjectID primitive.ObjectID `json:"_id,omitempty" bson:"_id,omitempty"` diff --git a/mysql/mysql.go b/mysql/mysql.go index c69f06bc..9972fff6 100644 --- a/mysql/mysql.go +++ b/mysql/mysql.go @@ -26,6 +26,7 @@ type Storage struct { // ErrNotFound means that a get call did not find the requested key. var ErrNotFound = errors.New("key not found") +var ErrKeyNotExist = ErrNotFound var ( dropQuery = "DROP TABLE IF EXISTS %s;" diff --git a/postgres/postgres.go b/postgres/postgres.go index ab4f5b64..db0d3f97 100644 --- a/postgres/postgres.go +++ b/postgres/postgres.go @@ -24,9 +24,9 @@ type Storage struct { sqlGC string } - // ErrNotFound means that a get call did not find the requested key. var ErrNotFound = errors.New("key not found") +var ErrKeyNotExist = ErrNotFound var ( dropQuery = `DROP TABLE IF EXISTS %s;` diff --git a/redis/redis.go b/redis/redis.go index e801d03b..3ce9ac9b 100644 --- a/redis/redis.go +++ b/redis/redis.go @@ -16,6 +16,7 @@ type Storage struct { // ErrNotFound means that a get call did not find the requested key. var ErrNotFound = errors.New("key not found") +var ErrKeyNotExist = ErrNotFound // New creates a new redis storage func New(config ...Config) *Storage { diff --git a/sqlite3/sqlite3.go b/sqlite3/sqlite3.go index 8c3e3d1a..c4ef6d93 100644 --- a/sqlite3/sqlite3.go +++ b/sqlite3/sqlite3.go @@ -26,6 +26,7 @@ type Storage struct { // ErrNotFound means that a get call did not find the requested key. var ErrNotFound = errors.New("key not found") +var ErrKeyNotExist = ErrNotFound var ( dropQuery = `DROP TABLE IF EXISTS %s;`