database

package
v0.0.0-...-0637115 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2020 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	POSTGRESQL         = "postgresql"
	MYSQL              = "mysql"
	DB_PASSWORD_LENGTH = 32
	DB_USER_LENGTH     = 14
)
View Source
const (
	NilDBInstanceErr     = "The required instance object is nil for the %s instance object"
	UnsupportedDBTypeErr = "Unsupported db type: %s"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseDatabaseInstance

type BaseDatabaseInstance struct {
	DatabaseInstance
	// contains filtered or unexported fields
}

func (*BaseDatabaseInstance) GetInstanceMetadata

func (b *BaseDatabaseInstance) GetInstanceMetadata() InstanceMetadata

type ConnectionInformation

type ConnectionInformation struct {
	Credentials
	Endpoint string
	Port     string
}

ConnectionInformation contains the information required for connecting to the instance

type Credentials

type Credentials struct {
	Username string
	Password string
}

Credentials contains authorization information

type Database

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

Database

func (*Database) Description

func (x *Database) Description() string

Description

func (*Database) Process

func (x *Database) Process(e transistor.Event) error

Process

func (*Database) SampleConfig

func (x *Database) SampleConfig() string

SampleConfig

func (*Database) Start

func (x *Database) Start(e chan transistor.Event) error

Start

func (*Database) Stop

func (x *Database) Stop()

Stop

func (*Database) Subscribe

func (x *Database) Subscribe() []string

Subscribe

type DatabaseInstance

type DatabaseInstance interface {
	CreateDatabaseAndUser(dbName string, username string, password string) (*DatabaseMetadata, error)
	DeleteDatabaseAndUser(dbName string, username string) error
	GetInstanceMetadata() InstanceMetadata
}

DatabaseInstace interface

type DatabaseMetadata

type DatabaseMetadata struct {
	Credentials
	Name string
}

DatabaseMetadata contains the information required for connecting to a specific database within a database instance

type InstanceMetadata

type InstanceMetadata struct {
	ConnectionInformation
}

InstanceMetadata contains metadata about the database and should be inherited by any struct implementing DatabaseInstance

type MySQL

type MySQL struct {
	BaseDatabaseInstance
	// contains filtered or unexported fields
}

MySQL

func (*MySQL) CreateDatabaseAndUser

func (m *MySQL) CreateDatabaseAndUser(dbName string, username string, password string) (*DatabaseMetadata, error)

CreateDatabase creates a db within the DB instance and creates and grants all read/write privileges to the requested userame

func (*MySQL) DeleteDatabaseAndUser

func (m *MySQL) DeleteDatabaseAndUser(dbName string, dbUser string) error

DeleteDatabaseAndUser deletes the requested database on the shared MySQL instance and also any roles associated with the database

type Postgres

type Postgres struct {
	BaseDatabaseInstance
	// contains filtered or unexported fields
}

Postgres

func (*Postgres) CreateDatabaseAndUser

func (p *Postgres) CreateDatabaseAndUser(dbName string, username string, password string) (*DatabaseMetadata, error)

CreateDatabase creates a db within the DB instance and creates and grants all read/write privileges to the requested userame

func (*Postgres) DeleteDatabaseAndUser

func (p *Postgres) DeleteDatabaseAndUser(dbName string, dbUser string) error

DeleteDatabaseAndUser deletes the requested database on the shared Postgres instance and also any roles associated with the database

Jump to

Keyboard shortcuts

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