mirror of
https://github.com/gofiber/storage.git
synced 2025-10-03 15:56:37 +08:00
Updated tests-scylladb and readme
This commit is contained in:
2
.github/workflows/test-scylladb.yml
vendored
2
.github/workflows/test-scylladb.yml
vendored
@@ -32,7 +32,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Create Default Keyspace
|
- name: Create Default Keyspace
|
||||||
run: |
|
run: |
|
||||||
docker exec -it scylladb cqlsh -e "CREATE KEYSPACE IF NOT EXISTS scylla_db WITH REPLICATION = {'class': 'SimpleStrategy', 'replication_factor': 1};"
|
docker exec --tty scylladb cqlsh -e "CREATE KEYSPACE IF NOT EXISTS scylla_db WITH REPLICATION = {'class': 'SimpleStrategy', 'replication_factor': 1};"
|
||||||
|
|
||||||
- name: Install Go
|
- name: Install Go
|
||||||
uses: actions/setup-go@v4
|
uses: actions/setup-go@v4
|
||||||
|
@@ -42,11 +42,10 @@ store := scylladb.New()
|
|||||||
|
|
||||||
// Initialize custom config
|
// Initialize custom config
|
||||||
store := scylladb.New(scylladb.Config{
|
store := scylladb.New(scylladb.Config{
|
||||||
Host: "127.0.0.1",
|
Hosts: []string{"127.0.0.1"},
|
||||||
Port: 9042,
|
Keyspace: "fiber_keyspace",
|
||||||
Database: "fiber",
|
Consistency: "ONE",
|
||||||
Collection: "fiber_storage",
|
Table: "fiber_table",
|
||||||
Reset: false,
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
@@ -55,15 +54,10 @@ store := scylladb.New(scylladb.Config{
|
|||||||
### Config
|
### Config
|
||||||
```go
|
```go
|
||||||
type Config struct {
|
type Config struct {
|
||||||
// Host name where the DB is hosted
|
// Hosts name where the DB is hosted
|
||||||
//
|
//
|
||||||
// Optional. Default is "127.0.0.1"
|
// Optional. Default is "127.0.0.1"
|
||||||
Host string
|
Hosts []string
|
||||||
|
|
||||||
// Port where the DB is listening on
|
|
||||||
//
|
|
||||||
// Optional. Default is 9042
|
|
||||||
Port int
|
|
||||||
|
|
||||||
// Server username
|
// Server username
|
||||||
//
|
//
|
||||||
@@ -80,6 +74,11 @@ type Config struct {
|
|||||||
// Optional. Default is "scylladb_db"
|
// Optional. Default is "scylladb_db"
|
||||||
Keyspace string
|
Keyspace string
|
||||||
|
|
||||||
|
// Level of the consistency
|
||||||
|
//
|
||||||
|
// Optional. Default is "LOCAL_ONE"
|
||||||
|
Consistency string
|
||||||
|
|
||||||
// Number of replication
|
// Number of replication
|
||||||
//
|
//
|
||||||
// Optional. Default 1
|
// Optional. Default 1
|
||||||
@@ -100,12 +99,12 @@ type Config struct {
|
|||||||
### Default Config
|
### Default Config
|
||||||
```go
|
```go
|
||||||
var ConfigDefault = Config{
|
var ConfigDefault = Config{
|
||||||
Host: "127.0.0.1",
|
Hosts: []string{"172.0.0.1"},
|
||||||
Port: 9042,
|
|
||||||
Username: "",
|
Username: "",
|
||||||
Password: "",
|
Password: "",
|
||||||
Table: "scylladb_table",
|
Table: "scylla_table",
|
||||||
Keyspace: "scylladb_db",
|
Keyspace: "scylla_db",
|
||||||
|
Consistency: "LOCAL_ONE",
|
||||||
ReplicationFactor: 1,
|
ReplicationFactor: 1,
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
@@ -43,7 +43,7 @@ type Config struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var ConfigDefault = Config{
|
var ConfigDefault = Config{
|
||||||
Hosts: []string{"172.19.0.10"},
|
Hosts: []string{"172.0.0.1"},
|
||||||
Username: "",
|
Username: "",
|
||||||
Password: "",
|
Password: "",
|
||||||
Table: "scylla_table",
|
Table: "scylla_table",
|
||||||
|
Reference in New Issue
Block a user