Documentation ¶
Index ¶
- Constants
- Variables
- func MySQLErrorNumber(err error) uint16
- type BackupInfo
- type Cmd
- type DSN
- type Handler
- type Process
- func (p *Process) Backup() (io.ReadCloser, error)
- func (p *Process) ConfigPath() string
- func (p *Process) DSN() *DSN
- func (p *Process) Info() (*client.DatabaseInfo, error)
- func (p *Process) Ready() <-chan state.DatabaseEvent
- func (p *Process) Reconfigure(config *state.Config) error
- func (p *Process) Restore(r io.Reader) (*BackupInfo, error)
- func (p *Process) Start() error
- func (p *Process) Stop() error
- func (p *Process) XLog() xlog.XLog
- func (p *Process) XLogPosition() (xlog.Position, error)
Constants ¶
View Source
const ( DefaultPort = "3306" DefaultBinDir = "/usr/bin" DefaultSbinDir = "/usr/sbin" DefaultDataDir = "/data" DefaultPassword = "" DefaultOpTimeout = 5 * time.Minute DefaultReplTimeout = 1 * time.Minute BinName = "mysqld" ConfigName = "my.cnf" )
Variables ¶
View Source
var ( // ErrRunning is returned when starting an already running process. ErrRunning = errors.New("process already running") // ErrStopped is returned when stopping an already stopped process. ErrStopped = errors.New("process already stopped") ErrNoReplicationStatus = errors.New("no replication status") )
Functions ¶
func MySQLErrorNumber ¶
MySQLErrorNumber returns the Number field from err if it is a *mysql.Error. Returns 0 for non-mysql error types.
Types ¶
type BackupInfo ¶
type Cmd ¶
Cmd wraps exec.Cmd and provides helpers for checking for expected exits.
func (*Cmd) Err ¶
Err returns an error if cmd stopped unexpectedly. Must wait for the Stopped channel to return first.
type Handler ¶
type Handler struct { Process *Process Peer *state.Peer Heartbeater discoverd.Heartbeater Logger log15.Logger // contains filtered or unexported fields }
Handler represents an HTTP API handler for the process.
type Process ¶
type Process struct { ID string Singleton bool Port string BinDir string SbinDir string DataDir string Password string ServerID uint32 OpTimeout time.Duration ReplTimeout time.Duration WaitUpstream bool Logger log15.Logger // contains filtered or unexported fields }
Process represents a MariaDB process.
func (*Process) Backup ¶
func (p *Process) Backup() (io.ReadCloser, error)
Backup returns a reader for streaming a backup in xbstream format.
func (*Process) ConfigPath ¶
func (*Process) DSN ¶
DSN returns the data source name for connecting to the local process as the "flynn" user.
func (*Process) Ready ¶
func (p *Process) Ready() <-chan state.DatabaseEvent
Click to show internal directories.
Click to hide internal directories.