Skip to content

Commit 07c24dd

Browse files
1 parent 4803f74 commit 07c24dd

File tree

11 files changed

+676
-40
lines changed

11 files changed

+676
-40
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,15 @@ type Storage interface {
5454
- [AzureBlob](./azureblob/README.md) <a href="https://github.com/gofiber/storage/actions?query=workflow%3A%22Tests+Azure+Blob%22"> <img src="https://img.shields.io/github/actions/workflow/status/gofiber/storage/test-azureblob.yml?branch=main&label=%F0%9F%A7%AA%20&style=flat&color=75C46B" /> </a>
5555
- [Badger](./badger/README.md) <a href="https://github.com/gofiber/storage/actions?query=workflow%3A%22Tests+Badger%22"> <img src="https://img.shields.io/github/actions/workflow/status/gofiber/storage/test-badger.yml?branch=main&label=%F0%9F%A7%AA%20&style=flat&color=75C46B" /> </a>
5656
- [Bbolt](./bbolt) <a href="https://github.com/gofiber/storage/actions?query=workflow%3A%22Tests+Bbolt%22"> <img src="https://img.shields.io/github/actions/workflow/status/gofiber/storage/test-bbolt.yml?branch=main&label=%F0%9F%A7%AA%20&style=flat&color=75C46B" /> </a>
57+
- [CloudflareKV](./cloudflarekv/README.md) <a href="https://github.com/gofiber/storage/actions?query=workflow%3A%22Tests+CloudflareKV%22"> <img src="https://img.shields.io/github/actions/workflow/status/gofiber/storage/test-cloudflarekv.yml?branch=main&label=%F0%9F%A7%AA%20&style=flat&color=75C46B" /> </a>
5758
- [Coherence](./coherence/README.md) <a href="https://github.com/gofiber/storage/actions?query=workflow%3A%22Tests+Coherence%22"> <img src="https://img.shields.io/github/actions/workflow/status/gofiber/storage/test-coherence.yml?branch=main&label=%F0%9F%A7%AA%20&style=flat&color=75C46B" /> </a>
5859
- [Couchbase](./couchbase/README.md) <a href="https://github.com/gofiber/storage/actions?query=workflow%3A%22Tests+Couchbase%22"> <img src="https://img.shields.io/github/actions/workflow/status/gofiber/storage/test-couchbase.yml?branch=main&label=%F0%9F%A7%AA%20&style=flat&color=75C46B" /> </a>
5960
- [DynamoDB](./dynamodb/README.md) <a href="https://github.com/gofiber/storage/actions?query=workflow%3A%22Tests+DynamoDB%22"> <img src="https://img.shields.io/github/actions/workflow/status/gofiber/storage/test-dynamodb.yml?branch=main&label=%F0%9F%A7%AA%20&style=flat&color=75C46B" /> </a>
6061
- [Etcd](./etcd/README.md) <a href="https://github.com/gofiber/storage/actions?query=workflow%3A%22Tests+Etcd%22"> <img src="https://img.shields.io/github/actions/workflow/status/gofiber/storage/test-etcd.yml?branch=main&label=%F0%9F%A7%AA%20&style=flat&color=75C46B" /> </a>
6162
- [Memcache](./memcache/README.md) <a href="https://github.com/gofiber/storage/actions?query=workflow%3A%22Tests+Memcache%22"> <img src="https://img.shields.io/github/actions/workflow/status/gofiber/storage/test-memcache.yml?branch=main&label=%F0%9F%A7%AA%20&style=flat&color=75C46B" /> </a>
6263
- [Memory](./memory/README.md) <a href="https://github.com/gofiber/storage/actions?query=workflow%3A%22Tests+Local+Storage%22"> <img src="https://img.shields.io/github/actions/workflow/status/gofiber/storage/test-memory.yml?branch=main&label=%F0%9F%A7%AA%20&style=flat&color=75C46B" /> </a>
6364
- [Minio](./minio/README.md) <a href="https://github.com/gofiber/storage/actions?query=workflow%3A%22Tests+Minio%22"> <img src="https://img.shields.io/github/actions/workflow/status/gofiber/storage/test-minio.yml?branch=main&label=%F0%9F%A7%AA%20&style=flat&color=75C46B" /> </a>
65+
- [MockStorage](./mockstorage/README.md) <a href="https://github.com/gofiber/storage/actions?query=workflow%3A%22Tests+MockStorage%22"> <img src="https://img.shields.io/github/actions/workflow/status/gofiber/storage/test-mockstorage.yml?branch=main&label=%F0%9F%A7%AA%20&style=flat&color=75C46B" /> </a>
6466
- [MongoDB](./mongodb/README.md) <a href="https://github.com/gofiber/storage/actions?query=workflow%3A%22Tests+Mongodb%22"> <img src="https://img.shields.io/github/actions/workflow/status/gofiber/storage/test-mongodb.yml?branch=main&label=%F0%9F%A7%AA%20&style=flat&color=75C46B" /> </a>
6567
- [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>
6668
- [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>
@@ -72,3 +74,5 @@ type Storage interface {
7274
- [S3](./s3/README.md) <a href="https://github.com/gofiber/storage/actions?query=workflow%3A%22Tests+S3%22"> <img src="https://img.shields.io/github/actions/workflow/status/gofiber/storage/test-s3.yml?branch=main&label=%F0%9F%A7%AA%20&style=flat&color=75C46B" /> </a>
7375
- [ScyllaDB](./scylladb/README.md) <a href="https://github.com/gofiber/storage/actions?query=workflow%3A%22Tests+scylladb%22"> <img src="https://img.shields.io/github/actions/workflow/status/gofiber/storage/test-scylladb.yml?branch=main&label=%F0%9F%A7%AA%20&style=flat&color=75C46B" /> </a>
7476
- [SQLite3](./sqlite3/README.md) <a href="https://github.com/gofiber/storage/actions?query=workflow%3A%22Tests+Sqlite3%22"> <img src="https://img.shields.io/github/actions/workflow/status/gofiber/storage/test-sqlite3.yml?branch=main&label=%F0%9F%A7%AA%20&style=flat&color=75C46B" /> </a>
77+
- [ClickHouse](./clickhouse/README.md) <a href="https://github.com/gofiber/storage/actions?query=workflow%3A%22Tests+Clickhouse%22"> <img src="https://img.shields.io/github/actions/workflow/status/gofiber/storage/test-clickhouse.yml?branch=main&label=%F0%9F%A7%AA%20&style=flat&color=75C46B" /> </a>
78+
- [Valkey](./valkey/README.md) <a href="https://github.com/gofiber/storage/actions?query=workflow%3A%22Tests+valkey%22"> <img src="https://img.shields.io/github/actions/workflow/status/gofiber/storage/test-valkey.yml?branch=main&label=%F0%9F%A7%AA%20&style=flat&color=75C46B" /> </a>
Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
# Clickhouse
2+
3+
A Clickhouse storage driver using [https://github.com/ClickHouse/clickhouse-go](https://github.com/ClickHouse/clickhouse-go).
4+
5+
### Table of Contents
6+
7+
- [Signatures](#signatures)
8+
- [Installation](#installation)
9+
- [Examples](#examples)
10+
- [Config](#config)
11+
- [Default Config](#default-config)
12+
13+
### Signatures
14+
15+
```go
16+
func New(config ...Config) (*Storage, error)
17+
func (s *Storage) Get(key string) ([]byte, error)
18+
func (s *Storage) Set(key string, val []byte, exp time.Duration) error
19+
func (s *Storage) Delete(key string) error
20+
func (s *Storage) Reset() error
21+
func (s *Storage) Close() error
22+
func (s *Storage) Conn() *Session
23+
```
24+
25+
### Installation
26+
27+
Clickhouse is supported on the latest two versions of Go:
28+
29+
Install the clickhouse implementation:
30+
```bash
31+
go get github.com/gofiber/storage/clickhouse
32+
```
33+
34+
### Running the tests
35+
36+
This module uses [Testcontainers for Go](https://github.com/testcontainers/testcontainers-go/) to run integration tests, which will start a local instance of Clickhouse as a Docker container under the hood. To run the tests, you must have Docker (or another container runtime 100% compatible with the Docker APIs) installed on your machine.
37+
38+
### Local development
39+
40+
Before running this implementation, you must ensure a Clickhouse cluster is available.
41+
For local development, we recommend using the Clickhouse Docker image; it contains everything
42+
necessary for the client to operate correctly.
43+
44+
To start Clickhouse using Docker, issue the following:
45+
46+
```bash
47+
docker run -d -p 9000:9000 --name some-clickhouse-server --ulimit nofile=262144:262144 clickhouse/clickhouse-server
48+
```
49+
50+
After running this command you're ready to start using the storage and connecting to the database.
51+
52+
### Examples
53+
54+
You can use the following options to create a clickhouse storage driver:
55+
```go
56+
import "github.com/gofiber/storage/clickhouse"
57+
58+
// Initialize default config, to connect to localhost:9000 using the memory engine and with a clean table.
59+
store, err := clickhouse.New(clickhouse.Config{
60+
Host: "localhost",
61+
Port: 9000,
62+
Clean: true,
63+
})
64+
65+
// Initialize custom config to connect to a different host/port and use custom engine and with clean table.
66+
store, err := clickhouse.New(clickhouse.Config{
67+
Host: "some-ip-address",
68+
Port: 9000,
69+
Engine: clickhouse.MergeTree,
70+
Clean: true,
71+
})
72+
73+
// Initialize to connect with TLS enabled with your own tls.Config and with clean table.
74+
tlsConfig := config := &tls.Config{...}
75+
76+
store, err := clickhouse.New(clickhouse.Config{
77+
Host: "some-ip-address",
78+
Port: 9000,
79+
Clean: true,
80+
TLSConfig: tlsConfig,
81+
})
82+
```
83+
84+
### Config
85+
86+
```go
87+
// Config defines configuration options for Clickhouse connection.
88+
type Config struct {
89+
// The host of the database. Ex: 127.0.0.1
90+
Host string
91+
// The port where the database is supposed to listen to. Ex: 9000
92+
Port int
93+
// The database that the connection should authenticate from
94+
Database string
95+
// The username to be used in the authentication
96+
Username string
97+
// The password to be used in the authentication
98+
Password string
99+
// The name of the table that will store the data
100+
Table string
101+
// The engine that should be used in the table
102+
Engine string
103+
// Should start a clean table, default false
104+
Clean bool
105+
// TLS configuration, default nil
106+
TLSConfig *tls.Config
107+
// Should the connection be in debug mode, default false
108+
Debug bool
109+
// The function to use with the debug config, default print function. It only works when debug is true
110+
Debugf func(format string, v ...any)
111+
}
112+
```
113+
114+
### Default Config
115+
116+
```go
117+
var DefaultConfig = Config{
118+
Host: "localhost",
119+
Port: 9000,
120+
Engine: "Memory",
121+
Clean: false,
122+
}
123+
```
Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
---
2+
id: cloudflarekv
3+
title: Cloudflare KV
4+
---
5+
6+
![Release](https://img.shields.io/github/v/tag/gofiber/storage?filter=cloudflarekv*)
7+
[![Discord](https://img.shields.io/discord/704680098577514527?style=flat&label=%F0%9F%92%AC%20discord&color=00ACD7)](https://gofiber.io/discord)
8+
![Test](https://img.shields.io/github/actions/workflow/status/gofiber/storage/test-cloudflarekv.yml?label=Tests)
9+
![Security](https://img.shields.io/github/actions/workflow/status/gofiber/storage/gosec.yml?label=Security)
10+
![Linter](https://img.shields.io/github/actions/workflow/status/gofiber/storage/linter.yml?label=Linter)
11+
12+
A Cloudflare KV storage driver using [cloudflare/cloudflare-go](https://github.com/cloudflare/cloudflare-go).
13+
14+
**Note: Requires Go 1.21 and above**
15+
16+
### Table of Contents
17+
18+
- [Signatures](#signatures)
19+
- [Installation](#installation)
20+
- [Examples](#examples)
21+
- [Config](#config)
22+
- [Default Config](#default-config)
23+
24+
### Signatures
25+
26+
```go
27+
func New(config ...Config) Storage
28+
func (s *Storage) Get(key string) ([]byte, error)
29+
func (s *Storage) Set(key string, val []byte, exp time.Duration) error
30+
func (s *Storage) Delete(key string) error
31+
func (s *Storage) Reset() error
32+
func (s *Storage) Close() error
33+
func (s *Storage) Conn() *cloudflare.API
34+
```
35+
36+
### Installation
37+
38+
```bash
39+
go mod init github.com/<user>/<repo>
40+
```
41+
42+
And then install the Cloudflare KV implementation:
43+
44+
```bash
45+
go get github.com/gofiber/storage/cloudflarekv
46+
```
47+
48+
### Examples
49+
50+
Import the storage package.
51+
52+
```go
53+
import "github.com/gofiber/storage/cloudflarekv"
54+
```
55+
56+
You can use the following methods to create storage. The Key must be an API Token generated with at least `Account.Workers KV Storage` permission. Check the [Create API Token](https://developers.cloudflare.com/fundamentals/api/get-started/create-token/) documentation to generate one.
57+
58+
```go
59+
// Initialize default config
60+
store := cloudflarekv.New()
61+
62+
store := cloudflarekv.New(cloudflarekv.Config{
63+
Key: "",
64+
Email: "",
65+
AccountID: "fiber",
66+
NamespaceID: "fiber",
67+
Reset: false,
68+
})
69+
70+
```
71+
72+
### Config
73+
74+
```go
75+
type Config struct {
76+
77+
// Cloudflare Auth Token
78+
//
79+
// Optional. Default is ""
80+
Key string
81+
82+
// Cloudflare Email
83+
//
84+
// Optional. Default is ""
85+
Email string
86+
87+
// Account id
88+
//
89+
// Optional. Default is "fiber"
90+
AccountID string
91+
92+
// Namespace id
93+
//
94+
// Optional. Default is "fiber"
95+
NamespaceID string
96+
97+
// Reset clears any existing keys in existing Table
98+
//
99+
// Optional. Default is false
100+
Reset bool
101+
}
102+
```
103+
104+
### Default Config
105+
106+
```go
107+
var ConfigDefault = Config{
108+
Key: "",
109+
Email: "",
110+
AccountID: "fiber",
111+
NamespaceID: "fiber",
112+
Reset: false,
113+
}
114+
```

storage_versioned_docs/version-postgres_v3.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

storage_versioned_docs/version-postgres_v3.x.x/minio/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,10 @@ type Config struct {
9494
// Optional. Default is false
9595
Reset bool
9696

97+
// The maximum number of times requests that encounter retryable failures should be attempted.
98+
// Optional. Default is 10, same as the MinIO client.
99+
MaxRetry int
100+
97101
// Credentials Minio access key and Minio secret key.
98102
// Need to be defined
99103
Credentials Credentials
@@ -124,6 +128,7 @@ var ConfigDefault = Config{
124128
Token: "",
125129
Secure: false,
126130
Reset: false,
131+
127132
Credentials: Credentials{},
128133
GetObjectOptions: minio.GetObjectOptions{},
129134
PutObjectOptions: minio.PutObjectOptions{},

0 commit comments

Comments
 (0)