mirror of
https://github.com/gofiber/storage.git
synced 2025-10-06 17:17:18 +08:00
🎨 update installation
This commit is contained in:
@@ -4,6 +4,7 @@ A Memcache storage driver using [`bradfitz/gomemcache`](https://github.com/bradf
|
|||||||
|
|
||||||
### Table of Contents
|
### Table of Contents
|
||||||
- [Signatures](#signatures)
|
- [Signatures](#signatures)
|
||||||
|
- [Installation](#installation)
|
||||||
- [Examples](#examples)
|
- [Examples](#examples)
|
||||||
- [Config](#config)
|
- [Config](#config)
|
||||||
- [Default Config](#default-config)
|
- [Default Config](#default-config)
|
||||||
@@ -14,6 +15,15 @@ func New(config ...Config) Storage
|
|||||||
|
|
||||||
var ErrNotExist = errors.New("key does not exist")
|
var ErrNotExist = errors.New("key does not exist")
|
||||||
```
|
```
|
||||||
|
### Installation
|
||||||
|
Memory is tested on the 2 last [Go versions](https://golang.org/dl/) with support for modules. So make sure to initialize one first if you didn't do that yet:
|
||||||
|
```bash
|
||||||
|
go mod init github.com/<user>/<repo>
|
||||||
|
```
|
||||||
|
And then install the memory implementation:
|
||||||
|
```bash
|
||||||
|
go get github.com/gofiber/storage/memory
|
||||||
|
```
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
Import the storage package.
|
Import the storage package.
|
||||||
|
@@ -4,10 +4,12 @@ An in-memory storage driver.
|
|||||||
|
|
||||||
### Table of Contents
|
### Table of Contents
|
||||||
- [Signatures](#signatures)
|
- [Signatures](#signatures)
|
||||||
|
- [Installation](#installation)
|
||||||
- [Examples](#examples)
|
- [Examples](#examples)
|
||||||
- [Config](#config)
|
- [Config](#config)
|
||||||
- [Default Config](#default-config)
|
- [Default Config](#default-config)
|
||||||
|
|
||||||
|
|
||||||
### Signatures
|
### Signatures
|
||||||
```go
|
```go
|
||||||
func New(config ...Config) Storage
|
func New(config ...Config) Storage
|
||||||
@@ -20,6 +22,16 @@ func (s *Storage) Delete(key string) error
|
|||||||
func (s *Storage) Clear() error
|
func (s *Storage) Clear() error
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Installation
|
||||||
|
Memory is tested on the 2 last [Go versions](https://golang.org/dl/) with support for modules. So make sure to initialize one first if you didn't do that yet:
|
||||||
|
```bash
|
||||||
|
go mod init github.com/<user>/<repo>
|
||||||
|
```
|
||||||
|
And then install the memory implementation:
|
||||||
|
```bash
|
||||||
|
go get github.com/gofiber/storage/memory
|
||||||
|
```
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
Import the storage package.
|
Import the storage package.
|
||||||
```go
|
```go
|
||||||
|
@@ -4,6 +4,7 @@ A MongoDB storage driver using [mongodb/mongo-go-driver](https://github.com/mong
|
|||||||
|
|
||||||
### Table of Contents
|
### Table of Contents
|
||||||
- [Signatures](#signatures)
|
- [Signatures](#signatures)
|
||||||
|
- [Installation](#installation)
|
||||||
- [Examples](#examples)
|
- [Examples](#examples)
|
||||||
- [Config](#config)
|
- [Config](#config)
|
||||||
- [Default Config](#default-config)
|
- [Default Config](#default-config)
|
||||||
@@ -19,6 +20,15 @@ func (s *Storage) Set(key string, val []byte, exp time.Duration) error
|
|||||||
func (s *Storage) Delete(key string) error
|
func (s *Storage) Delete(key string) error
|
||||||
func (s *Storage) Clear() error
|
func (s *Storage) Clear() error
|
||||||
```
|
```
|
||||||
|
### Installation
|
||||||
|
MongoDB is tested on the 2 last [Go versions](https://golang.org/dl/) with support for modules. So make sure to initialize one first if you didn't do that yet:
|
||||||
|
```bash
|
||||||
|
go mod init github.com/<user>/<repo>
|
||||||
|
```
|
||||||
|
And then install the mongodb implementation:
|
||||||
|
```bash
|
||||||
|
go get github.com/gofiber/storage/mongodb
|
||||||
|
```
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
Import the storage package.
|
Import the storage package.
|
||||||
|
@@ -4,6 +4,7 @@ A MySQL storage driver using `database/sql` and [go-sql-driver/mysql](https://gi
|
|||||||
|
|
||||||
### Table of Contents
|
### Table of Contents
|
||||||
- [Signatures](#signatures)
|
- [Signatures](#signatures)
|
||||||
|
- [Installation](#installation)
|
||||||
- [Examples](#examples)
|
- [Examples](#examples)
|
||||||
- [Config](#config)
|
- [Config](#config)
|
||||||
- [Default Config](#default-config)
|
- [Default Config](#default-config)
|
||||||
@@ -19,6 +20,15 @@ func (s *Storage) Set(key string, val []byte, exp time.Duration) error
|
|||||||
func (s *Storage) Delete(key string) error
|
func (s *Storage) Delete(key string) error
|
||||||
func (s *Storage) Clear() error
|
func (s *Storage) Clear() error
|
||||||
```
|
```
|
||||||
|
### Installation
|
||||||
|
MySQL is tested on the 2 last [Go versions](https://golang.org/dl/) with support for modules. So make sure to initialize one first if you didn't do that yet:
|
||||||
|
```bash
|
||||||
|
go mod init github.com/<user>/<repo>
|
||||||
|
```
|
||||||
|
And then install the mysql implementation:
|
||||||
|
```bash
|
||||||
|
go get github.com/gofiber/storage/mysql
|
||||||
|
```
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
Import the storage package.
|
Import the storage package.
|
||||||
|
@@ -4,6 +4,7 @@ A Postgres storage driver using [lib/pq](https://github.com/lib/pq).
|
|||||||
|
|
||||||
### Table of Contents
|
### Table of Contents
|
||||||
- [Signatures](#signatures)
|
- [Signatures](#signatures)
|
||||||
|
- [Installation](#installation)
|
||||||
- [Examples](#examples)
|
- [Examples](#examples)
|
||||||
- [Config](#config)
|
- [Config](#config)
|
||||||
- [Default Config](#default-config)
|
- [Default Config](#default-config)
|
||||||
@@ -19,6 +20,15 @@ func (s *Storage) Set(key string, val []byte, exp time.Duration) error
|
|||||||
func (s *Storage) Delete(key string) error
|
func (s *Storage) Delete(key string) error
|
||||||
func (s *Storage) Clear() error
|
func (s *Storage) Clear() error
|
||||||
```
|
```
|
||||||
|
### Installation
|
||||||
|
Postgres is tested on the 2 last [Go versions](https://golang.org/dl/) with support for modules. So make sure to initialize one first if you didn't do that yet:
|
||||||
|
```bash
|
||||||
|
go mod init github.com/<user>/<repo>
|
||||||
|
```
|
||||||
|
And then install the postgres implementation:
|
||||||
|
```bash
|
||||||
|
go get github.com/gofiber/storage/postgres
|
||||||
|
```
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
Import the storage package.
|
Import the storage package.
|
||||||
|
@@ -4,6 +4,7 @@ A Redis storage driver using [go-redis/redis](github.com/go-redis/redis).
|
|||||||
|
|
||||||
### Table of Contents
|
### Table of Contents
|
||||||
- [Signatures](#signatures)
|
- [Signatures](#signatures)
|
||||||
|
- [Installation](#installation)
|
||||||
- [Examples](#examples)
|
- [Examples](#examples)
|
||||||
- [Config](#config)
|
- [Config](#config)
|
||||||
- [Default Config](#default-config)
|
- [Default Config](#default-config)
|
||||||
@@ -19,6 +20,15 @@ func (s *Storage) Set(key string, val []byte, exp time.Duration) error
|
|||||||
func (s *Storage) Delete(key string) error
|
func (s *Storage) Delete(key string) error
|
||||||
func (s *Storage) Clear() error
|
func (s *Storage) Clear() error
|
||||||
```
|
```
|
||||||
|
### Installation
|
||||||
|
Redis is tested on the 2 last [Go versions](https://golang.org/dl/) with support for modules. So make sure to initialize one first if you didn't do that yet:
|
||||||
|
```bash
|
||||||
|
go mod init github.com/<user>/<repo>
|
||||||
|
```
|
||||||
|
And then install the redis implementation:
|
||||||
|
```bash
|
||||||
|
go get github.com/gofiber/storage/redis
|
||||||
|
```
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
Import the storage package.
|
Import the storage package.
|
||||||
|
@@ -4,6 +4,7 @@ A SQLite3 storage driver using [mattn/go-sqlite3](https://github.com/mattn/go-sq
|
|||||||
|
|
||||||
### Table of Contents
|
### Table of Contents
|
||||||
- [Signatures](#signatures)
|
- [Signatures](#signatures)
|
||||||
|
- [Installation](#installation)
|
||||||
- [Examples](#examples)
|
- [Examples](#examples)
|
||||||
- [Config](#config)
|
- [Config](#config)
|
||||||
- [Default Config](#default-config)
|
- [Default Config](#default-config)
|
||||||
@@ -19,6 +20,15 @@ func (s *Storage) Set(key string, val []byte, exp time.Duration) error
|
|||||||
func (s *Storage) Delete(key string) error
|
func (s *Storage) Delete(key string) error
|
||||||
func (s *Storage) Clear() error
|
func (s *Storage) Clear() error
|
||||||
```
|
```
|
||||||
|
### Installation
|
||||||
|
SQLite3 is tested on the 2 last [Go versions](https://golang.org/dl/) with support for modules. So make sure to initialize one first if you didn't do that yet:
|
||||||
|
```bash
|
||||||
|
go mod init github.com/<user>/<repo>
|
||||||
|
```
|
||||||
|
And then install the sqlite3 implementation:
|
||||||
|
```bash
|
||||||
|
go get github.com/gofiber/storage/sqlite3
|
||||||
|
```
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
Import the storage package.
|
Import the storage package.
|
||||||
|
Reference in New Issue
Block a user