Documentation ¶
Index ¶
- type ConnectionConfig
- type DBConnection
- type Driver
- type MySQLConnection
- func (c *MySQLConnection) Check() error
- func (c *MySQLConnection) Close() error
- func (c *MySQLConnection) CreateDB(ctx context.Context, dbName string) error
- func (c *MySQLConnection) CreateUser(ctx context.Context, user, password string) error
- func (c *MySQLConnection) DBExists(ctx context.Context, dbName string) (bool, error)
- func (c *MySQLConnection) DeleteDB(ctx context.Context, dbName string) error
- func (c *MySQLConnection) DeleteUser(ctx context.Context, user string) error
- func (c *MySQLConnection) GetHost() string
- func (c *MySQLConnection) GetPort() int
- func (c *MySQLConnection) GrantPrivileges(ctx context.Context, user, dbName string) error
- func (c *MySQLConnection) GrantPrivilegesExists(ctx context.Context, user, dbName string) (bool, error)
- func (c *MySQLConnection) RevokePrivileges(ctx context.Context, user, dbName string) error
- func (c *MySQLConnection) UserExists(ctx context.Context, user string) (bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConnectionConfig ¶
type ConnectionConfig struct { SQLDriver Driver User string Password string Host string Port int DBName string TLSConfig *tls.Config Parameters map[string][]string }
func (ConnectionConfig) GetDataSourceName ¶
func (config ConnectionConfig) GetDataSourceName() string
type DBConnection ¶
type DBConnection interface { CreateUser(ctx context.Context, user, password string) error CreateDB(ctx context.Context, dbName string) error GrantPrivileges(ctx context.Context, user, dbName string) error UserExists(ctx context.Context, user string) (bool, error) DBExists(ctx context.Context, dbName string) (bool, error) GrantPrivilegesExists(ctx context.Context, user, dbName string) (bool, error) DeleteUser(ctx context.Context, user string) error DeleteDB(ctx context.Context, dbName string) error RevokePrivileges(ctx context.Context, user, dbName string) error GetHost() string GetPort() int Close() error Check() error }
func GetDBConnection ¶
func GetDBConnection(config ConnectionConfig) (DBConnection, error)
type MySQLConnection ¶
type MySQLConnection struct {
// contains filtered or unexported fields
}
func (*MySQLConnection) Check ¶
func (c *MySQLConnection) Check() error
func (*MySQLConnection) Close ¶
func (c *MySQLConnection) Close() error
func (*MySQLConnection) CreateDB ¶
func (c *MySQLConnection) CreateDB(ctx context.Context, dbName string) error
func (*MySQLConnection) CreateUser ¶
func (c *MySQLConnection) CreateUser(ctx context.Context, user, password string) error
func (*MySQLConnection) DeleteDB ¶
func (c *MySQLConnection) DeleteDB(ctx context.Context, dbName string) error
func (*MySQLConnection) DeleteUser ¶
func (c *MySQLConnection) DeleteUser(ctx context.Context, user string) error
func (*MySQLConnection) GetHost ¶
func (c *MySQLConnection) GetHost() string
func (*MySQLConnection) GetPort ¶
func (c *MySQLConnection) GetPort() int
func (*MySQLConnection) GrantPrivileges ¶
func (c *MySQLConnection) GrantPrivileges(ctx context.Context, user, dbName string) error
func (*MySQLConnection) GrantPrivilegesExists ¶
func (*MySQLConnection) RevokePrivileges ¶
func (c *MySQLConnection) RevokePrivileges(ctx context.Context, user, dbName string) error
func (*MySQLConnection) UserExists ¶
Click to show internal directories.
Click to hide internal directories.