Documentation ¶
Index ¶
Constants ¶
const ( POSTGRESQL = "postgresql" MYSQL = "mysql" DB_PASSWORD_LENGTH = 32 DB_USER_LENGTH = 14 )
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 ¶
Credentials contains authorization information
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
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