Documentation ¶
Index ¶
- Variables
- type Connection
- func (conn *Connection) CheckHealth() error
- func (conn *Connection) Close() error
- func (conn *Connection) CreateDatabase(db string) error
- func (conn *Connection) CreateUser(username string, password string, database string) error
- func (conn *Connection) DropDatabase(db string) error
- func (conn *Connection) DropUser(username string) error
- func (conn *Connection) DropUserByHost(username string, address string) error
- func (conn *Connection) DropUserByHosts(username string, hosts []string) error
- func (conn *Connection) Grant(username string, password string, database string, address string) error
- func (conn *Connection) IsDatabaseExists(db string) (bool, error)
- func (conn *Connection) IsGrantPrivUser(user string, host string) (bool, error)
- func (conn *Connection) IsUserExists(username string, host string) (bool, error)
- func (conn *Connection) ShowGrants(user string, host string) (string, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var (
AllHosts = []string{"%", "127.0.0.1"}
)
Functions ¶
This section is empty.
Types ¶
type Connection ¶
type Connection struct { Host string Port int Username string Password string // contains filtered or unexported fields }
func NewConnection ¶
func NewConnection(info *apis.Mysql) (*Connection, error)
func (*Connection) CheckHealth ¶
func (conn *Connection) CheckHealth() error
func (*Connection) Close ¶
func (conn *Connection) Close() error
func (*Connection) CreateDatabase ¶
func (conn *Connection) CreateDatabase(db string) error
func (*Connection) CreateUser ¶
func (conn *Connection) CreateUser(username string, password string, database string) error
func (*Connection) DropDatabase ¶
func (conn *Connection) DropDatabase(db string) error
func (*Connection) DropUser ¶
func (conn *Connection) DropUser(username string) error
func (*Connection) DropUserByHost ¶
func (conn *Connection) DropUserByHost(username string, address string) error
func (*Connection) DropUserByHosts ¶
func (conn *Connection) DropUserByHosts(username string, hosts []string) error
func (*Connection) IsDatabaseExists ¶
func (conn *Connection) IsDatabaseExists(db string) (bool, error)
func (*Connection) IsGrantPrivUser ¶
func (conn *Connection) IsGrantPrivUser(user string, host string) (bool, error)
func (*Connection) IsUserExists ¶
func (conn *Connection) IsUserExists(username string, host string) (bool, error)
func (*Connection) ShowGrants ¶
func (conn *Connection) ShowGrants(user string, host string) (string, error)
Click to show internal directories.
Click to hide internal directories.