dbinit

package
v0.0.0-...-e739bdb Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreatedDatabase

func CreatedDatabase(log logging.Logger) (err error)

Types

type CassandraAdmin

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

func NewCassandraAdmin

func NewCassandraAdmin(logger logging.Logger, dbAddrs []string, dbAdminUsername string, dbAdminPassword string) (*CassandraAdmin, error)

func (*CassandraAdmin) Close

func (c *CassandraAdmin) Close()

func (*CassandraAdmin) CreateDb

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

func (*CassandraAdmin) CreateDbUser

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

func (*CassandraAdmin) CreateLockSchemaDb

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

func (*CassandraAdmin) GrantPermission

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

func (*CassandraAdmin) Session

func (c *CassandraAdmin) Session() *gocql.Session

type Config

type Config struct {
	DBAddresses           []string `envconfig:"DB_ADDRESSES" required:"true"`
	DBAdminCredIdentifier string   `envconfig:"DB_ADMIN_CRED_IDENTIFIER" default:"cassandra-admin"`
	DBReplicationFactor   string   `envconfig:"DB_REPLICATION_FACTOR" required:"true" default:"1"`
	EntityName            string   `envconfig:"DB_ENTITY_NAME" required:"true"`
	DBName                string   `envconfig:"DB_NAME" required:"true"`
	DBServiceUsername     string   `envconfig:"DB_SERVICE_USERNAME" required:"true"`
}

Jump to

Keyboard shortcuts

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