mirror of
https://github.com/gofiber/storage.git
synced 2025-09-27 21:02:20 +08:00
🎭 stay backwards compatible
This commit is contained in:
@@ -18,6 +18,7 @@ type Storage struct {
|
|||||||
|
|
||||||
// ErrNotFound means that a get call did not find the requested key.
|
// ErrNotFound means that a get call did not find the requested key.
|
||||||
var ErrNotFound = errors.New("key not found")
|
var ErrNotFound = errors.New("key not found")
|
||||||
|
var ErrKeyNotExist = ErrNotFound
|
||||||
|
|
||||||
// New creates a new memory storage
|
// New creates a new memory storage
|
||||||
func New(config ...Config) *Storage {
|
func New(config ...Config) *Storage {
|
||||||
|
@@ -21,6 +21,7 @@ type Storage struct {
|
|||||||
|
|
||||||
// ErrNotFound means that a get call did not find the requested key.
|
// ErrNotFound means that a get call did not find the requested key.
|
||||||
var ErrNotFound = errors.New("key not found")
|
var ErrNotFound = errors.New("key not found")
|
||||||
|
var ErrKeyNotExist = ErrNotFound
|
||||||
|
|
||||||
// New creates a new storage
|
// New creates a new storage
|
||||||
func New(config Config) *Storage {
|
func New(config Config) *Storage {
|
||||||
|
@@ -19,6 +19,7 @@ type Storage struct {
|
|||||||
|
|
||||||
// ErrNotFound means that a get call did not find the requested key.
|
// ErrNotFound means that a get call did not find the requested key.
|
||||||
var ErrNotFound = errors.New("key not found")
|
var ErrNotFound = errors.New("key not found")
|
||||||
|
var ErrKeyNotExist = ErrNotFound
|
||||||
|
|
||||||
// New creates a new storage
|
// New creates a new storage
|
||||||
func New(config ...Config) *Storage {
|
func New(config ...Config) *Storage {
|
||||||
|
@@ -17,6 +17,7 @@ type Storage struct {
|
|||||||
|
|
||||||
// ErrNotFound means that a get call did not find the requested key.
|
// ErrNotFound means that a get call did not find the requested key.
|
||||||
var ErrNotFound = errors.New("key not found")
|
var ErrNotFound = errors.New("key not found")
|
||||||
|
var ErrKeyNotExist = ErrNotFound
|
||||||
|
|
||||||
type entry struct {
|
type entry struct {
|
||||||
data []byte
|
data []byte
|
||||||
|
@@ -24,6 +24,7 @@ type Storage struct {
|
|||||||
|
|
||||||
// ErrNotFound means that a get call did not find the requested key.
|
// ErrNotFound means that a get call did not find the requested key.
|
||||||
var ErrNotFound = errors.New("key not found")
|
var ErrNotFound = errors.New("key not found")
|
||||||
|
var ErrKeyNotExist = ErrNotFound
|
||||||
|
|
||||||
type item struct {
|
type item struct {
|
||||||
ObjectID primitive.ObjectID `json:"_id,omitempty" bson:"_id,omitempty"`
|
ObjectID primitive.ObjectID `json:"_id,omitempty" bson:"_id,omitempty"`
|
||||||
|
@@ -26,6 +26,7 @@ type Storage struct {
|
|||||||
|
|
||||||
// ErrNotFound means that a get call did not find the requested key.
|
// ErrNotFound means that a get call did not find the requested key.
|
||||||
var ErrNotFound = errors.New("key not found")
|
var ErrNotFound = errors.New("key not found")
|
||||||
|
var ErrKeyNotExist = ErrNotFound
|
||||||
|
|
||||||
var (
|
var (
|
||||||
dropQuery = "DROP TABLE IF EXISTS %s;"
|
dropQuery = "DROP TABLE IF EXISTS %s;"
|
||||||
|
@@ -24,9 +24,9 @@ type Storage struct {
|
|||||||
sqlGC string
|
sqlGC string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ErrNotFound means that a get call did not find the requested key.
|
// ErrNotFound means that a get call did not find the requested key.
|
||||||
var ErrNotFound = errors.New("key not found")
|
var ErrNotFound = errors.New("key not found")
|
||||||
|
var ErrKeyNotExist = ErrNotFound
|
||||||
|
|
||||||
var (
|
var (
|
||||||
dropQuery = `DROP TABLE IF EXISTS %s;`
|
dropQuery = `DROP TABLE IF EXISTS %s;`
|
||||||
|
@@ -16,6 +16,7 @@ type Storage struct {
|
|||||||
|
|
||||||
// ErrNotFound means that a get call did not find the requested key.
|
// ErrNotFound means that a get call did not find the requested key.
|
||||||
var ErrNotFound = errors.New("key not found")
|
var ErrNotFound = errors.New("key not found")
|
||||||
|
var ErrKeyNotExist = ErrNotFound
|
||||||
|
|
||||||
// New creates a new redis storage
|
// New creates a new redis storage
|
||||||
func New(config ...Config) *Storage {
|
func New(config ...Config) *Storage {
|
||||||
|
@@ -26,6 +26,7 @@ type Storage struct {
|
|||||||
|
|
||||||
// ErrNotFound means that a get call did not find the requested key.
|
// ErrNotFound means that a get call did not find the requested key.
|
||||||
var ErrNotFound = errors.New("key not found")
|
var ErrNotFound = errors.New("key not found")
|
||||||
|
var ErrKeyNotExist = ErrNotFound
|
||||||
|
|
||||||
var (
|
var (
|
||||||
dropQuery = `DROP TABLE IF EXISTS %s;`
|
dropQuery = `DROP TABLE IF EXISTS %s;`
|
||||||
|
Reference in New Issue
Block a user