From 1ceff481a8d97ff8c74357bcbbe6e8270e2ef998 Mon Sep 17 00:00:00 2001 From: Fenny <25108519+Fenny@users.noreply.github.com> Date: Sat, 31 Oct 2020 09:08:00 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=A5=20fix=20reference?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- memcached/memcached.go | 8 ++++---- mysql/mysql.go | 8 ++++---- postgres/postgres.go | 8 ++++---- redis/redis.go | 8 ++++---- sqlite3/sqlite3.go | 8 ++++---- 5 files changed, 20 insertions(+), 20 deletions(-) diff --git a/memcached/memcached.go b/memcached/memcached.go index 4399110f..b2653f13 100644 --- a/memcached/memcached.go +++ b/memcached/memcached.go @@ -21,21 +21,21 @@ func New(config ...Config) Storage { } // Get value by key -func (store Storage) Get(key string) ([]byte, error) { +func (store *Storage) Get(key string) ([]byte, error) { return []byte{}, nil } // Set key with value -func (store Storage) Set(key string, val []byte, exp time.Duration) error { +func (store *Storage) Set(key string, val []byte, exp time.Duration) error { return nil } // Delete key by key -func (store Storage) Delete(key string) error { +func (store *Storage) Delete(key string) error { return nil } // Clear all keys -func (store Storage) Clear() error { +func (store *Storage) Clear() error { return nil } diff --git a/mysql/mysql.go b/mysql/mysql.go index d3ab2ae4..93335f38 100644 --- a/mysql/mysql.go +++ b/mysql/mysql.go @@ -21,21 +21,21 @@ func New(config ...Config) Storage { } // Get value by key -func (store Storage) Get(key string) ([]byte, error) { +func (store *Storage) Get(key string) ([]byte, error) { return []byte{}, nil } // Set key with value -func (store Storage) Set(key string, val []byte, exp time.Duration) error { +func (store *Storage) Set(key string, val []byte, exp time.Duration) error { return nil } // Delete key by key -func (store Storage) Delete(key string) error { +func (store *Storage) Delete(key string) error { return nil } // Clear all keys -func (store Storage) Clear() error { +func (store *Storage) Clear() error { return nil } diff --git a/postgres/postgres.go b/postgres/postgres.go index 06008860..1d753a64 100644 --- a/postgres/postgres.go +++ b/postgres/postgres.go @@ -21,21 +21,21 @@ func New(config ...Config) Storage { } // Get value by key -func (store Storage) Get(key string) ([]byte, error) { +func (store *Storage) Get(key string) ([]byte, error) { return []byte{}, nil } // Set key with value -func (store Storage) Set(key string, val []byte, exp time.Duration) error { +func (store *Storage) Set(key string, val []byte, exp time.Duration) error { return nil } // Delete key by key -func (store Storage) Delete(key string) error { +func (store *Storage) Delete(key string) error { return nil } // Clear all keys -func (store Storage) Clear() error { +func (store *Storage) Clear() error { return nil } diff --git a/redis/redis.go b/redis/redis.go index 55d34794..a881ee79 100644 --- a/redis/redis.go +++ b/redis/redis.go @@ -58,7 +58,7 @@ func New(config ...Config) Storage { } // Get value by key -func (store Storage) Get(key string) ([]byte, error) { +func (store *Storage) Get(key string) ([]byte, error) { val, err := store.db.Get(context.Background(), key).Bytes() if err != nil { if err != redis.Nil { @@ -70,16 +70,16 @@ func (store Storage) Get(key string) ([]byte, error) { } // Set key with value -func (store Storage) Set(key string, val []byte, exp time.Duration) error { +func (store *Storage) Set(key string, val []byte, exp time.Duration) error { return store.db.Set(context.Background(), key, val, exp).Err() } // Delete key by key -func (store Storage) Delete(key string) error { +func (store *Storage) Delete(key string) error { return store.db.Del(context.Background(), key).Err() } // Clear all keys -func (store Storage) Clear() error { +func (store *Storage) Clear() error { return store.db.FlushDB(context.Background()).Err() } diff --git a/sqlite3/sqlite3.go b/sqlite3/sqlite3.go index c2c433e5..f35e117b 100644 --- a/sqlite3/sqlite3.go +++ b/sqlite3/sqlite3.go @@ -21,21 +21,21 @@ func New(config ...Config) Storage { } // Get value by key -func (store Storage) Get(key string) ([]byte, error) { +func (store *Storage) Get(key string) ([]byte, error) { return []byte{}, nil } // Set key with value -func (store Storage) Set(key string, val []byte, exp time.Duration) error { +func (store *Storage) Set(key string, val []byte, exp time.Duration) error { return nil } // Delete key by key -func (store Storage) Delete(key string) error { +func (store *Storage) Delete(key string) error { return nil } // Clear all keys -func (store Storage) Clear() error { +func (store *Storage) Clear() error { return nil }