cassandra

package
v0.0.0-...-73f03d9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 20, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

README

cqlsh -u cassandra -p cassandra LIST USERS;

Documentation

Overview

Package cassandra contains ...

Package cassandra contains ...

Package cassandra contains ...

Package cassandra contains ...

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create

func Create(log logging.Logger) error

Types

type CassandraStore

type CassandraStore struct {
	// contains filtered or unexported fields
}

func NewCassandraStore

func NewCassandraStore(logger logging.Logger, sess *gocql.Session) (store *CassandraStore)

func (*CassandraStore) Close

func (c *CassandraStore) Close()

func (*CassandraStore) Connect

func (c *CassandraStore) Connect(dbAddrs []string, dbAdminUsername string, dbAdminPassword string) (err error)

func (*CassandraStore) CreateDb

func (c *CassandraStore) CreateDb(dbName string, replicationFactor string) (err error)

func (*CassandraStore) CreateDbUser

func (c *CassandraStore) CreateDbUser(serviceUsername string, servicePassword string) (err error)

func (*CassandraStore) CreateLockSchemaDb

func (c *CassandraStore) CreateLockSchemaDb(replicationFactor string) (err error)

func (*CassandraStore) GrantPermission

func (c *CassandraStore) GrantPermission(serviceUsername string, dbName string) (err error)

type DBConfig

type DBConfig struct {
	DbAddresses         []string `envconfig:"DB_ADDRESSES" required:"true"`
	DbAdminUsername     string   `envconfig:"DB_ADMIN_USERNAME" required:"true"`
	DbServiceUsername   string   `envconfig:"DB_SERVICE_USERNAME" required:"true"`
	DbName              string   `envconfig:"CASSANDRA_DB_NAME" required:"true"`
	DbReplicationFactor string   `envconfig:"DB_REPLICATION_FACTOR" required:"true"`
	DbAdminPassword     string   `envconfig:"DB_ADMIN_PASSWD" required:"true"`
	DbServicePassword   string   `envconfig:"DB_SERVICE_PASSWD" required:"true"`
}

type DbConfigurator

type DbConfigurator struct {
	// contains filtered or unexported fields
}

func NewDbConfigurator

func NewDbConfigurator(logger logging.Logger, stor Store) (handler *DbConfigurator)

func (*DbConfigurator) ConfigureDb

func (dbConf *DbConfigurator) ConfigureDb(conf DBConfig) (err error)

type Store

type Store interface {
	Connect(dbAddrs []string, dbAdminUsername string, dbAdminPassword string) (err error)
	Close()
	CreateDbUser(serviceUsername string, servicePassword string) (err error)
	GrantPermission(serviceUsername string, dbName string) (err error)
	CreateDb(dbName string, replicationFactor string) (err error)
	CreateLockSchemaDb(replicationFactor string) (err error)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL