mirror of
https://github.com/gofiber/storage.git
synced 2025-09-27 04:46:08 +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
|
||||
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
|
||||
uses: actions/setup-go@v4
|
||||
|
@@ -42,11 +42,10 @@ store := scylladb.New()
|
||||
|
||||
// Initialize custom config
|
||||
store := scylladb.New(scylladb.Config{
|
||||
Host: "127.0.0.1",
|
||||
Port: 9042,
|
||||
Database: "fiber",
|
||||
Collection: "fiber_storage",
|
||||
Reset: false,
|
||||
Hosts: []string{"127.0.0.1"},
|
||||
Keyspace: "fiber_keyspace",
|
||||
Consistency: "ONE",
|
||||
Table: "fiber_table",
|
||||
})
|
||||
|
||||
|
||||
@@ -55,15 +54,10 @@ store := scylladb.New(scylladb.Config{
|
||||
### Config
|
||||
```go
|
||||
type Config struct {
|
||||
// Host name where the DB is hosted
|
||||
// Hosts name where the DB is hosted
|
||||
//
|
||||
// Optional. Default is "127.0.0.1"
|
||||
Host string
|
||||
|
||||
// Port where the DB is listening on
|
||||
//
|
||||
// Optional. Default is 9042
|
||||
Port int
|
||||
Hosts []string
|
||||
|
||||
// Server username
|
||||
//
|
||||
@@ -80,6 +74,11 @@ type Config struct {
|
||||
// Optional. Default is "scylladb_db"
|
||||
Keyspace string
|
||||
|
||||
// Level of the consistency
|
||||
//
|
||||
// Optional. Default is "LOCAL_ONE"
|
||||
Consistency string
|
||||
|
||||
// Number of replication
|
||||
//
|
||||
// Optional. Default 1
|
||||
@@ -100,12 +99,12 @@ type Config struct {
|
||||
### Default Config
|
||||
```go
|
||||
var ConfigDefault = Config{
|
||||
Host: "127.0.0.1",
|
||||
Port: 9042,
|
||||
Username: "",
|
||||
Password: "",
|
||||
Table: "scylladb_table",
|
||||
Keyspace: "scylladb_db",
|
||||
ReplicationFactor: 1,
|
||||
Hosts: []string{"172.0.0.1"},
|
||||
Username: "",
|
||||
Password: "",
|
||||
Table: "scylla_table",
|
||||
Keyspace: "scylla_db",
|
||||
Consistency: "LOCAL_ONE",
|
||||
ReplicationFactor: 1,
|
||||
}
|
||||
```
|
||||
|
@@ -43,7 +43,7 @@ type Config struct {
|
||||
}
|
||||
|
||||
var ConfigDefault = Config{
|
||||
Hosts: []string{"172.19.0.10"},
|
||||
Hosts: []string{"172.0.0.1"},
|
||||
Username: "",
|
||||
Password: "",
|
||||
Table: "scylla_table",
|
||||
|
Reference in New Issue
Block a user