db

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrRestartAfterClone = errors.New("Error 3707: Restart server failed (mysqld is not managed by supervisor process).")

Functions

This section is empty.

Types

type DB

type DB struct {
	// contains filtered or unexported fields
}

func NewDatabase

func NewDatabase(ctx context.Context, params DBParams) (*DB, error)

func (*DB) CheckIfInPrimaryPartition

func (d *DB) CheckIfInPrimaryPartition(ctx context.Context) (bool, error)

func (*DB) Clone

func (d *DB) Clone(ctx context.Context, donor, user, pass string, port int32) error

func (*DB) CloneInProgress

func (d *DB) CloneInProgress(ctx context.Context) (bool, error)

func (*DB) Close

func (d *DB) Close() error

func (*DB) DisableSuperReadonly

func (d *DB) DisableSuperReadonly(ctx context.Context) error

func (*DB) DumbQuery

func (d *DB) DumbQuery(ctx context.Context) error

func (*DB) EnableSuperReadonly

func (d *DB) EnableSuperReadonly(ctx context.Context) error

func (*DB) GetMemberState

func (d *DB) GetMemberState(ctx context.Context, host string) (db.MemberState, error)

func (*DB) IsReadonly

func (d *DB) IsReadonly(ctx context.Context) (bool, error)

func (*DB) IsReplica

func (d *DB) IsReplica(ctx context.Context) (bool, error)

func (*DB) ReplicationStatus

func (d *DB) ReplicationStatus(ctx context.Context) (db.ReplicationStatus, string, error)

func (*DB) ReportHost

func (d *DB) ReportHost(ctx context.Context) (string, error)

func (*DB) ResetReplication

func (d *DB) ResetReplication(ctx context.Context) error

func (*DB) StartReplication

func (d *DB) StartReplication(ctx context.Context, host, replicaPass string, port int32) error

func (*DB) StopReplication

func (d *DB) StopReplication(ctx context.Context) error

type DBParams

type DBParams struct {
	User apiv1.SystemUser
	Pass string
	Host string
	Port int32

	ReadTimeoutSeconds uint32
}

func (*DBParams) DSN

func (p *DBParams) DSN() string

type ReplicationStatus

type ReplicationStatus int8

Jump to

Keyboard shortcuts

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