mirror of
https://github.com/gofiber/storage.git
synced 2025-12-23 20:47:13 +08:00
Update clickhouse README.md
This commit is contained in:
committed by
GitHub
parent
e744bc09fa
commit
f9d76aa3d6
@@ -44,13 +44,11 @@ docker run -d -p 9000:9000 --name some-clickhouse-server --ulimit nofile=262144:
|
|||||||
After running this command you're ready to start using the storage and connecting to the database.
|
After running this command you're ready to start using the storage and connecting to the database.
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
Import the storage package.
|
|
||||||
```go
|
|
||||||
import "github.com/gofiber/storage/coherence"
|
|
||||||
```
|
|
||||||
|
|
||||||
You can use the following possibilities to create a storage:
|
You can use the following options to create a clickhouse storage driver:
|
||||||
```go
|
```go
|
||||||
|
import "github.com/gofiber/storage/clickhouse"
|
||||||
|
|
||||||
// Initialize default config, to connect to localhost:9000 using the memory engine and with a clean table.
|
// Initialize default config, to connect to localhost:9000 using the memory engine and with a clean table.
|
||||||
store, err := clickhouse.New(clickhouse.Config{
|
store, err := clickhouse.New(clickhouse.Config{
|
||||||
Host: "localhost",
|
Host: "localhost",
|
||||||
@@ -69,7 +67,7 @@ store, err := clickhouse.New(clickhouse.Config{
|
|||||||
// Initialize to connect with TLS enabled with your own tls.Config and with clean table.
|
// Initialize to connect with TLS enabled with your own tls.Config and with clean table.
|
||||||
tlsConfig := config := &tls.Config{...}
|
tlsConfig := config := &tls.Config{...}
|
||||||
|
|
||||||
store, err := clickhouse.New(coherence.Config{
|
store, err := clickhouse.New(clickhouse.Config{
|
||||||
Host: "some-ip-address",
|
Host: "some-ip-address",
|
||||||
Port: 9000,
|
Port: 9000,
|
||||||
Clean: true,
|
Clean: true,
|
||||||
@@ -116,4 +114,4 @@ var DefaultConfig = Config{
|
|||||||
Engine: "Memory",
|
Engine: "Memory",
|
||||||
Clean: false,
|
Clean: false,
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|||||||
Reference in New Issue
Block a user