mirror of
https://github.com/gofiber/storage.git
synced 2025-10-05 08:37:10 +08:00
✏ update signatures
This commit is contained in:
@@ -11,6 +11,8 @@ A Memcache storage driver using [`bradfitz/gomemcache`](https://github.com/bradf
|
||||
### Signatures
|
||||
```go
|
||||
func New(config ...Config) Storage
|
||||
|
||||
var ErrNotExist = errors.New("key does not exist")
|
||||
```
|
||||
|
||||
### Examples
|
||||
|
@@ -62,7 +62,7 @@ func New(config ...Config) *Storage {
|
||||
func (s *Storage) Get(key string) ([]byte, error) {
|
||||
item, err := s.db.Get(key)
|
||||
if err == mc.ErrCacheMiss {
|
||||
return nil, nil
|
||||
return nil, ErrNotExist
|
||||
} else if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@@ -11,6 +11,13 @@ An in-memory storage driver.
|
||||
### Signatures
|
||||
```go
|
||||
func New(config ...Config) Storage
|
||||
|
||||
var ErrNotExist = errors.New("key does not exist")
|
||||
|
||||
func (s *Storage) Get(key string) ([]byte, error)
|
||||
func (s *Storage) Set(key string, val []byte, exp time.Duration) error
|
||||
func (s *Storage) Delete(key string) error
|
||||
func (s *Storage) Clear() error
|
||||
```
|
||||
|
||||
### Examples
|
||||
|
@@ -11,6 +11,13 @@ A MongoDB storage driver using [mongodb/mongo-go-driver](https://github.com/mong
|
||||
### Signatures
|
||||
```go
|
||||
func New(config ...Config) Storage
|
||||
|
||||
var ErrNotExist = errors.New("key does not exist")
|
||||
|
||||
func (s *Storage) Get(key string) ([]byte, error)
|
||||
func (s *Storage) Set(key string, val []byte, exp time.Duration) error
|
||||
func (s *Storage) Delete(key string) error
|
||||
func (s *Storage) Clear() error
|
||||
```
|
||||
|
||||
### Examples
|
||||
|
@@ -11,6 +11,13 @@ A MySQL storage driver using `database/sql` and [go-sql-driver/mysql](https://gi
|
||||
### Signatures
|
||||
```go
|
||||
func New(config ...Config) Storage
|
||||
|
||||
var ErrNotExist = errors.New("key does not exist")
|
||||
|
||||
func (s *Storage) Get(key string) ([]byte, error)
|
||||
func (s *Storage) Set(key string, val []byte, exp time.Duration) error
|
||||
func (s *Storage) Delete(key string) error
|
||||
func (s *Storage) Clear() error
|
||||
```
|
||||
|
||||
### Examples
|
||||
|
@@ -11,6 +11,13 @@ A Postgres storage driver using [lib/pq](https://github.com/lib/pq).
|
||||
### Signatures
|
||||
```go
|
||||
func New(config ...Config) Storage
|
||||
|
||||
var ErrNotExist = errors.New("key does not exist")
|
||||
|
||||
func (s *Storage) Get(key string) ([]byte, error)
|
||||
func (s *Storage) Set(key string, val []byte, exp time.Duration) error
|
||||
func (s *Storage) Delete(key string) error
|
||||
func (s *Storage) Clear() error
|
||||
```
|
||||
|
||||
### Examples
|
||||
|
@@ -11,6 +11,13 @@ A Redis storage driver using [go-redis/redis](github.com/go-redis/redis).
|
||||
### Signatures
|
||||
```go
|
||||
func New(config ...Config) Storage
|
||||
|
||||
var ErrNotExist = errors.New("key does not exist")
|
||||
|
||||
func (s *Storage) Get(key string) ([]byte, error)
|
||||
func (s *Storage) Set(key string, val []byte, exp time.Duration) error
|
||||
func (s *Storage) Delete(key string) error
|
||||
func (s *Storage) Clear() error
|
||||
```
|
||||
|
||||
### Examples
|
||||
|
@@ -11,6 +11,13 @@ A SQLite3 storage driver using [mattn/go-sqlite3](https://github.com/mattn/go-sq
|
||||
### Signatures
|
||||
```go
|
||||
func New(config ...Config) Storage
|
||||
|
||||
var ErrNotExist = errors.New("key does not exist")
|
||||
|
||||
func (s *Storage) Get(key string) ([]byte, error)
|
||||
func (s *Storage) Set(key string, val []byte, exp time.Duration) error
|
||||
func (s *Storage) Delete(key string) error
|
||||
func (s *Storage) Clear() error
|
||||
```
|
||||
|
||||
### Examples
|
||||
|
Reference in New Issue
Block a user