Updated tests-scylladb and readme

This commit is contained in:
chris.grundling
2023-10-24 21:34:03 +02:00
parent 2f5ae09380
commit 0732a00253
3 changed files with 20 additions and 21 deletions

View File

@@ -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

View File

@@ -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,
} }
``` ```

View File

@@ -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",