mirror of
https://github.com/gofiber/storage.git
synced 2025-10-05 00:33:03 +08:00
🧥 fix reference
This commit is contained in:
@@ -21,21 +21,21 @@ func New(config ...Config) Storage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get value by key
|
// Get value by key
|
||||||
func (store Storage) Get(key string) ([]byte, error) {
|
func (store *Storage) Get(key string) ([]byte, error) {
|
||||||
return []byte{}, nil
|
return []byte{}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set key with value
|
// 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
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Delete key by key
|
// Delete key by key
|
||||||
func (store Storage) Delete(key string) error {
|
func (store *Storage) Delete(key string) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clear all keys
|
// Clear all keys
|
||||||
func (store Storage) Clear() error {
|
func (store *Storage) Clear() error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@@ -21,21 +21,21 @@ func New(config ...Config) Storage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get value by key
|
// Get value by key
|
||||||
func (store Storage) Get(key string) ([]byte, error) {
|
func (store *Storage) Get(key string) ([]byte, error) {
|
||||||
return []byte{}, nil
|
return []byte{}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set key with value
|
// 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
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Delete key by key
|
// Delete key by key
|
||||||
func (store Storage) Delete(key string) error {
|
func (store *Storage) Delete(key string) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clear all keys
|
// Clear all keys
|
||||||
func (store Storage) Clear() error {
|
func (store *Storage) Clear() error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@@ -21,21 +21,21 @@ func New(config ...Config) Storage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get value by key
|
// Get value by key
|
||||||
func (store Storage) Get(key string) ([]byte, error) {
|
func (store *Storage) Get(key string) ([]byte, error) {
|
||||||
return []byte{}, nil
|
return []byte{}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set key with value
|
// 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
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Delete key by key
|
// Delete key by key
|
||||||
func (store Storage) Delete(key string) error {
|
func (store *Storage) Delete(key string) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clear all keys
|
// Clear all keys
|
||||||
func (store Storage) Clear() error {
|
func (store *Storage) Clear() error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@@ -58,7 +58,7 @@ func New(config ...Config) Storage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get value by key
|
// 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()
|
val, err := store.db.Get(context.Background(), key).Bytes()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if err != redis.Nil {
|
if err != redis.Nil {
|
||||||
@@ -70,16 +70,16 @@ func (store Storage) Get(key string) ([]byte, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Set key with value
|
// 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()
|
return store.db.Set(context.Background(), key, val, exp).Err()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Delete key by key
|
// 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()
|
return store.db.Del(context.Background(), key).Err()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clear all keys
|
// Clear all keys
|
||||||
func (store Storage) Clear() error {
|
func (store *Storage) Clear() error {
|
||||||
return store.db.FlushDB(context.Background()).Err()
|
return store.db.FlushDB(context.Background()).Err()
|
||||||
}
|
}
|
||||||
|
@@ -21,21 +21,21 @@ func New(config ...Config) Storage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get value by key
|
// Get value by key
|
||||||
func (store Storage) Get(key string) ([]byte, error) {
|
func (store *Storage) Get(key string) ([]byte, error) {
|
||||||
return []byte{}, nil
|
return []byte{}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set key with value
|
// 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
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Delete key by key
|
// Delete key by key
|
||||||
func (store Storage) Delete(key string) error {
|
func (store *Storage) Delete(key string) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clear all keys
|
// Clear all keys
|
||||||
func (store Storage) Clear() error {
|
func (store *Storage) Clear() error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user