Documentation
¶
Index ¶
- func MySQLResetRootPassword(password string) error
- type Database
- type MySQL
- func (r *MySQL) Close()
- func (r *MySQL) DatabaseCreate(name string) error
- func (r *MySQL) DatabaseDrop(name string) error
- func (r *MySQL) DatabaseExists(name string) (bool, error)
- func (r *MySQL) DatabaseSize(name string) (int64, error)
- func (r *MySQL) Databases() ([]Database, error)
- func (r *MySQL) Exec(query string, args ...any) (sql.Result, error)
- func (r *MySQL) Ping() error
- func (r *MySQL) Prepare(query string) (*sql.Stmt, error)
- func (r *MySQL) PrivilegesGrant(user, database string, host ...string) error
- func (r *MySQL) PrivilegesRevoke(user, database string, host ...string) error
- func (r *MySQL) Query(query string, args ...any) (*sql.Rows, error)
- func (r *MySQL) QueryRow(query string, args ...any) *sql.Row
- func (r *MySQL) UserCreate(user, password string, host ...string) error
- func (r *MySQL) UserDrop(user string, host ...string) error
- func (r *MySQL) UserPassword(user, password string, host ...string) error
- func (r *MySQL) UserPrivileges(user string, host ...string) ([]string, error)
- func (r *MySQL) Users() ([]User, error)
- type Operator
- type Postgres
- func (r *Postgres) Close()
- func (r *Postgres) DatabaseComment(name, comment string) error
- func (r *Postgres) DatabaseCreate(name string) error
- func (r *Postgres) DatabaseDrop(name string) error
- func (r *Postgres) DatabaseExists(name string) (bool, error)
- func (r *Postgres) DatabaseSize(name string) (int64, error)
- func (r *Postgres) Databases() ([]Database, error)
- func (r *Postgres) Exec(query string, args ...any) (sql.Result, error)
- func (r *Postgres) Ping() error
- func (r *Postgres) Prepare(query string) (*sql.Stmt, error)
- func (r *Postgres) PrivilegesGrant(user, database string, host ...string) error
- func (r *Postgres) PrivilegesRevoke(user, database string, host ...string) error
- func (r *Postgres) Query(query string, args ...any) (*sql.Rows, error)
- func (r *Postgres) QueryRow(query string, args ...any) *sql.Row
- func (r *Postgres) UserCreate(user, password string, host ...string) error
- func (r *Postgres) UserDrop(user string, host ...string) error
- func (r *Postgres) UserPassword(user, password string, host ...string) error
- func (r *Postgres) UserPrivileges(user string, host ...string) ([]string, error)
- func (r *Postgres) Users() ([]User, error)
- type Redis
- func (r *Redis) Clear() error
- func (r *Redis) Close()
- func (r *Redis) Data(page, pageSize int) ([]RedisKV, int, error)
- func (r *Redis) Database() (int, error)
- func (r *Redis) Del(keys ...string) error
- func (r *Redis) Exec(command string, args ...any) (any, error)
- func (r *Redis) Expire(key string, ttl int64) error
- func (r *Redis) Get(key string) (*RedisKV, error)
- func (r *Redis) Rename(oldKey, newKey string) error
- func (r *Redis) Search(pattern string, page, pageSize int) ([]RedisKV, int, error)
- func (r *Redis) Select(db int) error
- func (r *Redis) SetKey(key, value, keyType string, ttl int64) error
- func (r *Redis) Size() (int, error)
- type RedisKV
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MySQLResetRootPassword ¶
MySQLResetRootPassword 重置 MySQL root密码
Types ¶
type MySQL ¶
type MySQL struct {
// contains filtered or unexported fields
}
func (*MySQL) DatabaseCreate ¶
func (*MySQL) DatabaseDrop ¶
func (*MySQL) PrivilegesGrant ¶
func (*MySQL) PrivilegesRevoke ¶
func (*MySQL) UserPassword ¶
func (*MySQL) UserPrivileges ¶
type Operator ¶
type Operator interface {
Close()
Ping() error
Query(query string, args ...any) (*sql.Rows, error)
QueryRow(query string, args ...any) *sql.Row
Exec(query string, args ...any) (sql.Result, error)
Prepare(query string) (*sql.Stmt, error)
DatabaseCreate(name string) error
DatabaseDrop(name string) error
DatabaseExists(name string) (bool, error)
DatabaseSize(name string) (int64, error)
UserCreate(user, password string, host ...string) error
UserDrop(user string, host ...string) error
UserPassword(user, password string, host ...string) error
UserPrivileges(user string, host ...string) ([]string, error)
PrivilegesGrant(user, database string, host ...string) error
PrivilegesRevoke(user, database string, host ...string) error
Users() ([]User, error)
Databases() ([]Database, error)
}
type Postgres ¶
type Postgres struct {
// contains filtered or unexported fields
}
func (*Postgres) DatabaseComment ¶
func (*Postgres) DatabaseCreate ¶
func (*Postgres) DatabaseDrop ¶
func (*Postgres) PrivilegesGrant ¶
func (*Postgres) PrivilegesRevoke ¶
func (*Postgres) UserCreate ¶
func (*Postgres) UserPassword ¶
func (*Postgres) UserPrivileges ¶
type Redis ¶
type Redis struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.