Skip to content

Commit 325b6d6

Browse files
1 parent 36dce0f commit 325b6d6

File tree

5 files changed

+161
-4
lines changed

5 files changed

+161
-4
lines changed

storage_versioned_docs/version-valkey_v0.x.x/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ type Storage interface {
6767
- [MSSQL](./mssql/README.md) <a href="https://github.com/gofiber/storage/actions?query=workflow%3A%22Tests+MSSQL%22"> <img src="https://img.shields.io/github/actions/workflow/status/gofiber/storage/test-mssql.yml?branch=main&label=%F0%9F%A7%AA%20&style=flat&color=75C46B" /> </a>
6868
- [MySQL](./mysql/README.md) <a href="https://github.com/gofiber/storage/actions?query=workflow%3A%22Tests+MySQL%22"> <img src="https://img.shields.io/github/actions/workflow/status/gofiber/storage/test-mysql.yml?branch=main&label=%F0%9F%A7%AA%20&style=flat&color=75C46B" /> </a>
6969
- [NATS](./nats/README.md) <a href="https://github.com/gofiber/storage/actions?query=workflow%3A%22Tests%20Nats%20Driver%22"> <img src="https://img.shields.io/github/actions/workflow/status/gofiber/storage/test-nats.yml?branch=main&label=%F0%9F%A7%AA%20&style=flat&color=75C46B" /> </a>
70+
- [Neo4j](./neo4j/README.md) <a href="https://github.com/gofiber/storage/actions?query=workflow%3A%22Tests+Neo4j%22"> <img src="https://img.shields.io/github/actions/workflow/status/gofiber/storage/test-neo4j.yml?branch=main&label=%F0%9F%A7%AA%20&style=flat&color=75C46B" /> </a>
7071
- [Pebble](./pebble/README.md) <a href="https://github.com/gofiber/storage/actions?query=workflow%3A%22Tests+Pebble%22"> <img src="https://img.shields.io/github/actions/workflow/status/gofiber/storage/test-pebble.yml?branch=main&label=%F0%9F%A7%AA%20&style=flat&color=75C46B" /> </a>
7172
- [Postgres](./postgres/README.md) <a href="https://github.com/gofiber/storage/actions?query=workflow%3A%22Tests+Postgres%22"> <img src="https://img.shields.io/github/actions/workflow/status/gofiber/storage/test-postgres.yml?branch=main&label=%F0%9F%A7%AA%20&style=flat&color=75C46B" /> </a>
7273
- [Redis](./redis/README.md) <a href="https://github.com/gofiber/storage/actions?query=workflow%3A%22Tests+Redis%22"> <img src="https://img.shields.io/github/actions/workflow/status/gofiber/storage/test-redis.yml?branch=main&label=%F0%9F%A7%AA%20&style=flat&color=75C46B" /> </a>

storage_versioned_docs/version-valkey_v0.x.x/arangodb/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ ArangoDB is tested on the 2 last (1.14/1.15) [Go versions](https://golang.org/dl
3535
```bash
3636
go mod init github.com/<user>/<repo>
3737
```
38-
And then install the mysql implementation:
38+
And then install the arangodb implementation:
3939
```bash
4040
go get github.com/gofiber/storage/arangodb/v2
4141
```

storage_versioned_docs/version-valkey_v0.x.x/coherence/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Coherence
2-
<!-- Copyright © 2023, Oracle and/or its affiliates. -->
2+
<!-- Copyright © 2023, 2025 Oracle and/or its affiliates. -->
33
A Coherence storage driver using [https://github.com/oracle/coherence-go-client](https://github.com/oracle/coherence-go-client).
44

55
### Table of Contents
@@ -35,10 +35,10 @@ necessary for the client to operate correctly.
3535
To start a Coherence cluster using Docker, issue the following:
3636

3737
```bash
38-
docker run -d -p 1408:1408 ghcr.io/oracle/coherence-ce:22.06.7
38+
docker run -d -p 1408:1408 ghcr.io/oracle/coherence-ce:24.09
3939
```
4040

41-
See the documentation [here](https://pkg.go.dev/github.com/oracle/coherence-go-client/coherence#hdr-Obtaining_a_Session) on connection options
41+
See the documentation [here](https://pkg.go.dev/github.com/oracle/coherence-go-client/[email protected]/coherence#hdr-Obtaining_a_Session) on connection options
4242
when creating a Coherence session.
4343

4444
### Examples
Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
---
2+
id: neo4j
3+
title: Neo4j
4+
---
5+
6+
A Neo4j storage driver using [neo4j/neo4j-go-driver](https://github.com/neo4j/neo4j-go-driver).
7+
8+
> **Note: Requires latest two release of Golang**
9+
10+
### Table of Contents
11+
12+
- [Signatures](#signatures)
13+
- [Installation](#installation)
14+
- [Examples](#examples)
15+
- [Config](#config)
16+
- [Default Config](#default-config)
17+
18+
### Signatures
19+
20+
```go
21+
func New(config ...Config) Storage
22+
func (s *Storage) Get(key string) ([]byte, error)
23+
func (s *Storage) Set(key string, val []byte, exp time.Duration) error
24+
func (s *Storage) Delete(key string) error
25+
func (s *Storage) Reset() error
26+
func (s *Storage) Close() error
27+
func (s *Storage) Conn() neo4j.DriverWithContext
28+
```
29+
30+
### Installation
31+
32+
Neo4j 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:
33+
34+
```bash
35+
go mod init github.com/<user>/<repo>
36+
```
37+
38+
And then install the neo4j implementation:
39+
40+
```bash
41+
go get github.com/gofiber/storage/neo4j
42+
```
43+
44+
### Examples
45+
46+
Import the storage package.
47+
48+
```go
49+
import neo4jstore "github.com/gofiber/storage/neo4j"
50+
```
51+
52+
You can use the following possibilities to create a storage:
53+
54+
```go
55+
// Initialize default config
56+
store := neo4j.New()
57+
58+
// Initialize custom config
59+
store := neo4j.New(neo4jstore.Config{
60+
DB: driver,
61+
Node: "fiber_storage",
62+
Reset: false,
63+
GCInterval: 10 * time.Second,
64+
})
65+
```
66+
67+
### Config
68+
69+
```go
70+
// Config defines the config for storage.
71+
type Config struct {
72+
// Connection pool
73+
//
74+
// DB neo4j.DriverWithContext object will override connection uri and other connection fields.
75+
//
76+
// Optional. Default is nil.
77+
DB neo4j.DriverWithContext
78+
79+
// Target Server
80+
//
81+
// Optional. Default is "neo4j://localhost"
82+
URI string
83+
84+
// Connection authentication
85+
//
86+
// Auth auth.TokenManager will override Username and Password fields
87+
//
88+
// Optional. Default is nil.
89+
Auth auth.TokenManager
90+
91+
// Connection configurations
92+
//
93+
// Optional. Default is nil
94+
Configurations []func(*config.Config)
95+
96+
// Server username
97+
//
98+
// Optional. Default is ""
99+
Username string
100+
101+
// Server password
102+
//
103+
// Optional. Default is ""
104+
Password string
105+
106+
// Node name
107+
//
108+
// Optional. Default is "fiber_storage"
109+
Node string
110+
111+
// Reset clears any existing keys in existing Table
112+
//
113+
// Optional. Default is false
114+
Reset bool
115+
116+
// Time before deleting expired keys
117+
//
118+
// Optional. Default is 10 * time.Second
119+
GCInterval time.Duration
120+
}
121+
```
122+
123+
#### A note on Authentication
124+
125+
If auth is enabled on your server, then authentication must be provided in one of the three ways (the previous overrides the next):
126+
127+
- Via the connection pool, `neo4j.DriverWithContext`, provided on the `DB` field.
128+
- Via the `Auth` field: it must be an `auth.TokenManager` whose value is any one but `neo4j.NoAuth()`.
129+
- By setting both `Username` and `Password` fields: This will cause this storage driver to use Basic Auth.
130+
131+
Otherwise, your neo4j driver will panic with authorization error.
132+
133+
In contrast, if auth is disabled on your server, there's no need to provide any authentication parameter.
134+
135+
### Default Config
136+
137+
Used only for optional fields
138+
139+
```go
140+
var ConfigDefault = Config{
141+
URI: "neo4j://localhost",
142+
Node: "fiber_storage",
143+
Reset: false,
144+
GCInterval: 10 * time.Second,
145+
}
146+
```

storage_versioned_docs/version-valkey_v0.x.x/redis/README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@ func (s *Storage) Keys() ([][]byte, error)
3333
```
3434
### Installation
3535
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:
36+
37+
> **Note:** You can also use [DragonflyDB](https://dragonflydb.io/) as a Redis replacement.
38+
> Since DragonflyDB is fully compatible with the Redis API, you can use it exactly like Redis **without any code changes**.
39+
> [Example](#example-using-dragonflydb)
40+
41+
3642
```bash
3743
go mod init github.com/<user>/<repo>
3844
```
@@ -194,3 +200,7 @@ var ConfigDefault = Config{
194200
SentinelPassword: "",
195201
}
196202
```
203+
204+
### Example: Using DragonflyDB
205+
> **Note:** You can use [DragonflyDB](https://dragonflydb.io/) in the same way as Redis.
206+
> Simply start a DragonflyDB server and configure it just like Redis. Then, call `New()` and use it exactly as you would with Redis.

0 commit comments

Comments
 (0)