mysql

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

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) Grant

func (conn *Connection) Grant(username string, password string, database string, address 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)

Jump to

Keyboard shortcuts

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