client

package
v1.9.6 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2024 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConnWithSSL added in v1.9.0

func ConnWithSSL(ssl, skipVerify bool, clientKey, clientCert, rootCert string) (string, error)

func VerifyPeerCertFunc added in v1.9.0

func VerifyPeerCertFunc(pool *x509.CertPool) func([][]byte, [][]*x509.Certificate) error

Types

type AccessChangeInfo

type AccessChangeInfo struct {
	Name          string `json:"name"`
	Version       string `json:"version"`
	Username      string `json:"userName"`
	Password      string `json:"password"`
	OldPermission string `json:"oldPermission"`
	Permission    string `json:"permission"`

	Timeout uint `json:"timeout"` // second
}

type BackupInfo

type BackupInfo struct {
	Name      string `json:"name"`
	Format    string `json:"format"`
	TargetDir string `json:"targetDir"`
	FileName  string `json:"fileName"`

	Timeout uint `json:"timeout"` // second
}

type CreateInfo

type CreateInfo struct {
	Name       string `json:"name"`
	Format     string `json:"format"`
	Version    string `json:"version"`
	Username   string `json:"userName"`
	Password   string `json:"password"`
	Permission string `json:"permission"`

	Timeout uint `json:"timeout"` // second
}

type DBInfo

type DBInfo struct {
	From     string `json:"from"`
	Database string `json:"database"`
	Address  string `json:"address"`
	Port     uint   `json:"port"`
	Username string `json:"userName"`
	Password string `json:"password"`

	SSL        bool   `json:"ssl"`
	RootCert   string `json:"rootCert"`
	ClientKey  string `json:"clientKey"`
	ClientCert string `json:"clientCert"`
	SkipVerify bool   `json:"skipVerify"`

	Timeout uint `json:"timeout"` // second
}

type DeleteInfo

type DeleteInfo struct {
	Name       string `json:"name"`
	Version    string `json:"version"`
	Username   string `json:"userName"`
	Permission string `json:"permission"`

	ForceDelete bool `json:"forceDelete"`
	Timeout     uint `json:"timeout"` // second
}

type Local

type Local struct {
	PrefixCommand []string
	Database      string
	Password      string
	ContainerName string
}

func NewLocal

func NewLocal(command []string, containerName, password, database string) *Local

func (*Local) Backup

func (r *Local) Backup(info BackupInfo) error

func (*Local) ChangeAccess

func (r *Local) ChangeAccess(info AccessChangeInfo) error

func (*Local) ChangePassword

func (r *Local) ChangePassword(info PasswordChangeInfo) error

func (*Local) Close

func (r *Local) Close()

func (*Local) Create

func (r *Local) Create(info CreateInfo) error

func (*Local) CreateUser

func (r *Local) CreateUser(info CreateInfo, withDeleteDB bool) error

func (*Local) Delete

func (r *Local) Delete(info DeleteInfo) error

func (*Local) ExecSQL

func (r *Local) ExecSQL(command string, timeout uint) error

func (*Local) ExecSQLForRows

func (r *Local) ExecSQLForRows(command string, timeout uint) ([]string, error)

func (*Local) Recover

func (r *Local) Recover(info RecoverInfo) error

func (*Local) SyncDB

func (r *Local) SyncDB(version string) ([]SyncDBInfo, error)

type PasswordChangeInfo

type PasswordChangeInfo struct {
	Name       string `json:"name"`
	Version    string `json:"version"`
	Username   string `json:"userName"`
	Password   string `json:"password"`
	Permission string `json:"permission"`

	Timeout uint `json:"timeout"` // second
}

type RecoverInfo

type RecoverInfo struct {
	Name       string `json:"name"`
	Format     string `json:"format"`
	SourceFile string `json:"sourceFile"`

	Timeout uint `json:"timeout"` // second
}

type Remote

type Remote struct {
	Client   *sql.DB
	Database string
	User     string
	Password string
	Address  string
	Port     uint

	SSL        bool
	RootCert   string
	ClientKey  string
	ClientCert string
	SkipVerify bool
}

func NewRemote

func NewRemote(db Remote) *Remote

func (*Remote) Backup

func (r *Remote) Backup(info BackupInfo) error

func (*Remote) ChangeAccess

func (r *Remote) ChangeAccess(info AccessChangeInfo) error

func (*Remote) ChangePassword

func (r *Remote) ChangePassword(info PasswordChangeInfo) error

func (*Remote) Close

func (r *Remote) Close()

func (*Remote) Create

func (r *Remote) Create(info CreateInfo) error

func (*Remote) CreateUser

func (r *Remote) CreateUser(info CreateInfo, withDeleteDB bool) error

func (*Remote) Delete

func (r *Remote) Delete(info DeleteInfo) error

func (*Remote) ExecSQL

func (r *Remote) ExecSQL(command string, timeout uint) error

func (*Remote) ExecSQLForHosts

func (r *Remote) ExecSQLForHosts(timeout uint) ([]string, error)

func (*Remote) Recover

func (r *Remote) Recover(info RecoverInfo) error

func (*Remote) SyncDB

func (r *Remote) SyncDB(version string) ([]SyncDBInfo, error)

type SyncDBInfo

type SyncDBInfo struct {
	Name       string `json:"name"`
	From       string `json:"from"`
	MysqlName  string `json:"mysqlName"`
	Format     string `json:"format"`
	Username   string `json:"username"`
	Password   string `json:"password"`
	Permission string `json:"permission"`
}

Jump to

Keyboard shortcuts

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