mirror of
https://github.com/gofiber/storage.git
synced 2025-10-05 08:37:10 +08:00
Fix spacing in README.md
This commit is contained in:

committed by
GitHub

parent
cce70b9e7f
commit
12ea6b4978
@@ -9,11 +9,10 @@ title: Valkey
|
|||||||

|

|
||||||

|

|
||||||
|
|
||||||
A fast Valkey Storage that does auto pipelining and supports client side caching. [valkey-io/valkey](https://github.com/valkey-io/valkey).
|
A fast Valkey Storage that does auto pipelining and supports client side caching. Implementation is based on [valkey-io/valkey](https://github.com/valkey-io/valkey-go).
|
||||||
|
|
||||||
**Note: Requires Go 1.23 and above**
|
|
||||||
|
|
||||||
### Table of Contents
|
### Table of Contents
|
||||||
|
|
||||||
- [Signatures](#signatures)
|
- [Signatures](#signatures)
|
||||||
- [Installation](#installation)
|
- [Installation](#installation)
|
||||||
- [Examples](#examples)
|
- [Examples](#examples)
|
||||||
@@ -21,6 +20,7 @@ A fast Valkey Storage that does auto pipelining and supports client side caching
|
|||||||
- [Default Config](#default-config)
|
- [Default Config](#default-config)
|
||||||
|
|
||||||
### Signatures
|
### Signatures
|
||||||
|
|
||||||
```go
|
```go
|
||||||
func New(config ...Config) Storage
|
func New(config ...Config) Storage
|
||||||
func (s *Storage) Get(key string) ([]byte, error)
|
func (s *Storage) Get(key string) ([]byte, error)
|
||||||
@@ -30,23 +30,31 @@ func (s *Storage) Reset() error
|
|||||||
func (s *Storage) Close() error
|
func (s *Storage) Close() error
|
||||||
func (s *Storage) Conn() valkey.Client
|
func (s *Storage) Conn() valkey.Client
|
||||||
```
|
```
|
||||||
|
|
||||||
### Installation
|
### Installation
|
||||||
Valkey is tested on the latest [Go version](https://golang.org/dl/) with support for modules. So make sure to initialize one first if you didn't do that yet:
|
|
||||||
|
The valkey driver is tested on the latest two [Go version](https://golang.org/dl/) with support for modules. So make sure to initialize one first if you didn't do that yet:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
go mod init github.com/<user>/<repo>
|
go mod init github.com/<user>/<repo>
|
||||||
```
|
```
|
||||||
|
|
||||||
And then install the valkey implementation:
|
And then install the valkey implementation:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
go get github.com/gofiber/storage/valkey
|
go get github.com/gofiber/storage/valkey
|
||||||
```
|
```
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
Import the storage package.
|
Import the storage package.
|
||||||
|
|
||||||
```go
|
```go
|
||||||
import "github.com/gofiber/storage/valkey"
|
import "github.com/gofiber/storage/valkey"
|
||||||
```
|
```
|
||||||
|
|
||||||
You can use the one of the following options to create a Valkey Storage:
|
You can use the one of the following options to create a Valkey Storage:
|
||||||
|
|
||||||
```go
|
```go
|
||||||
// Initialize default config (localhost:6379)
|
// Initialize default config (localhost:6379)
|
||||||
store := valkey.New()
|
store := valkey.New()
|
||||||
@@ -93,6 +101,7 @@ store = valkey.New(valkey.Config{
|
|||||||
```
|
```
|
||||||
|
|
||||||
### Config
|
### Config
|
||||||
|
|
||||||
```go
|
```go
|
||||||
type Config struct {
|
type Config struct {
|
||||||
// Server username
|
// Server username
|
||||||
@@ -189,6 +198,7 @@ type Config struct {
|
|||||||
```
|
```
|
||||||
|
|
||||||
### Default Config
|
### Default Config
|
||||||
|
|
||||||
```go
|
```go
|
||||||
var ConfigDefault = Config{
|
var ConfigDefault = Config{
|
||||||
Username: "",
|
Username: "",
|
||||||
|
Reference in New Issue
Block a user