Skip to content

Commit

Permalink
ScyllaDb readme cleanup, added set port from config.
Browse files Browse the repository at this point in the history
  • Loading branch information
chris-grundling-vaimo committed Oct 24, 2023
1 parent fc00b75 commit 3f4bff9
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 21 deletions.
42 changes: 21 additions & 21 deletions scylladb/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ store := scylladb.New()

// Initialize custom config
store := scylladb.New(scylladb.Config{
Keyspace: "fiber",
Hosts: []string{"127.0.0.1"},
Port: 9042,
Table: "fiber_storage",
Consistency: "ONE",
Reset: false,
Keyspace: "fiber",
Hosts: []string{"127.0.0.1"},
Port: 9042,
Table: "fiber_storage",
Consistency: "ONE",
Reset: false,
})

// Initialize custom config using scylladb connection
Expand All @@ -74,47 +74,47 @@ store := scylladb.New(scylladb.Config{
```go
type Config struct {
// Session Will override Keyspace and all other authentication values if used
//
//
// Optional. Default is nil
Session *gocql.Session

// Keyspace name
//
//
// Optional. Default is "fiber"
Keyspace string

// Host name where the ScyllaDb cluster is hosted
//
// Optional. Default is "127.0.0.1"
Hosts []string
// Host name where the ScyllaDb cluster is hosted
//
// Optional. Default is "127.0.0.1"
Hosts []string

// Port where the ScyllaDb cluster is listening on
//
//
// Optional. Default is 9042
Port int

// Username for ScyllaDb cluster
//
//
// Optional. Default is ""
Username string

// Password for ScyllaDb cluster
//
//
// Optional. Default is ""
Password string

// Table name
//
//
// Optional. Default is "fiber_storage"
Table string

// Level of the consistency
//
// Optional. Default is "LOCAL_ONE"
Consistency string
// Level of the consistency
//
// Optional. Default is "LOCAL_ONE"
Consistency string

// Reset clears any existing keys in existing Table
//
//
// Optional. Default is false
Reset bool
}
Expand Down
1 change: 1 addition & 0 deletions scylladb/scylladb.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ func New(config ...Config) *Storage {
// Create a cassandra cluster
cluster := gocql.NewCluster(cfg.Hosts...)
cluster.Consistency = gocql.ParseConsistency(cfg.Consistency)
cluster.Port = cfg.Port

// Set credentials if provided
if cfg.Username != "" && cfg.Password != "" {
Expand Down

0 comments on commit 3f4bff9

Please sign in to comment.