Documentation ¶
Index ¶
Constants ¶
View Source
const ( // PrivilegeAll allows a user to perform all operations on a database. PrivilegeAll = "ALL" // PrivilegeProcess allows a user to see process information. PrivilegeProcess = "PROCESS" // PrivilegeReplication allows a user to see replication information. PrivilegeReplication = "REPLICATION CLIENT" // PrivilegeSelect allows a user to perform select operations. PrivilegeSelect = "SELECT" // PrivilegeInsert allows for insert operations. PrivilegeInsert = "INSERT" // PrivilegeUpdate allows for update operations. PrivilegeUpdate = "UPDATE" // PrivilegeDelete allows for delete operations. PrivilegeDelete = "DELETE" // PrivilegeCreate allows for create operations. PrivilegeCreate = "CREATE" // PrivilegeDrop allows for drop operations. PrivilegeDrop = "DROP" // PrivilegeIndex allows for index operations. PrivilegeIndex = "INDEX" // PrivilegeAlter allows for alter operations. PrivilegeAlter = "ALTER" // PrivilegeCrateTemporaryTables allows for temporary tables. PrivilegeCrateTemporaryTables = "CREATE TEMPORARY TABLES" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client for interacting with MySQL.
func (*Client) Database ¶
func (m *Client) Database() *DatabaseClient
Database returns the Database client.
type DatabaseClient ¶
type DatabaseClient struct {
// contains filtered or unexported fields
}
DatabaseClient for interacting with
func (DatabaseClient) Create ¶
func (d DatabaseClient) Create(name string) error
Create will create a database and fail if it already exists.
func (DatabaseClient) Delete ¶
func (d DatabaseClient) Delete(name string) error
Delete will delete a database if it exists.
func (DatabaseClient) Exists ¶
func (d DatabaseClient) Exists(name string) (bool, error)
Exists returns if a database exists.
func (DatabaseClient) List ¶
func (d DatabaseClient) List() ([]string, error)
List returns a list of databases.
type GrantClient ¶
type GrantClient struct {
// contains filtered or unexported fields
}
GrantClient for interacting with MySQL.
func (GrantClient) Create ¶
func (d GrantClient) Create(username, database string, privileges []string) error
Create a database and error if it exists.
func (GrantClient) Exists ¶
func (d GrantClient) Exists(username, database string) (bool, error)
Exists checks if the grant exists.
func (GrantClient) List ¶
func (d GrantClient) List(username string) ([]string, error)
List returns a list of grants.
func (GrantClient) Revoke ¶
func (d GrantClient) Revoke(username, database string) error
Revoke grant if it exists.
type UserClient ¶
type UserClient struct {
// contains filtered or unexported fields
}
UserClient for interacting with MySQL.
func (UserClient) Create ¶
func (d UserClient) Create(username, password string) error
Create a user and error if it already exists.
Click to show internal directories.
Click to hide internal directories.