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: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BackupInfo

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

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

type CreateInfo

type CreateInfo struct {
	Name      string `json:"name"`
	Username  string `json:"userName"`
	Password  string `json:"password"`
	SuperUser bool   `json:"superUser"`

	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"`

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

type DeleteInfo

type DeleteInfo struct {
	Name     string `json:"name"`
	Username string `json:"userName"`

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

type Local

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

func NewLocal

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

func (*Local) Backup

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

func (*Local) ChangePassword

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

func (*Local) ChangePrivileges

func (r *Local) ChangePrivileges(info Privileges) 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() ([]SyncDBInfo, error)

type PasswordChangeInfo

type PasswordChangeInfo struct {
	Username string `json:"userName"`
	Password string `json:"password"`

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

type Privileges

type Privileges struct {
	Username  string `json:"userName"`
	SuperUser bool   `json:"superUser"`

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

type RecoverInfo

type RecoverInfo struct {
	Name       string `json:"name"`
	SourceFile string `json:"sourceFile"`
	Username   string `json:"username"`

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

type Remote

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

func NewRemote

func NewRemote(db Remote) *Remote

func (*Remote) Backup

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

func (*Remote) ChangePassword

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

func (*Remote) ChangePrivileges

func (r *Remote) ChangePrivileges(info Privileges) 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) Recover

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

func (*Remote) SyncDB

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

type Status

type Status struct {
	Uptime              string `json:"uptime"`
	Version             string `json:"version"`
	MaxConnections      string `json:"max_connections"`
	Autovacuum          string `json:"autovacuum"`
	CurrentConnections  string `json:"current_connections"`
	HitRatio            string `json:"hit_ratio"`
	SharedBuffers       string `json:"shared_buffers"`
	BuffersClean        string `json:"buffers_clean"`
	MaxwrittenClean     string `json:"maxwritten_clean"`
	BuffersBackendFsync string `json:"buffers_backend_fsync"`
}

type SyncDBInfo

type SyncDBInfo struct {
	Name           string `json:"name"`
	From           string `json:"from"`
	PostgresqlName string `json:"postgresqlName"`
}

Jump to

Keyboard shortcuts

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