gprel

package module
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2020 License: MIT Imports: 11 Imported by: 0

README

gprel

Build Status Go Report Card MIT License

Golang Purge RElay Logs
inspired by https://github.com/yoshinorim/mha4mysql-node/blob/master/bin/purge_relay_logs

Motivation

I'm using orchestrator to achieve MySQL HA.
Pseudo-GTID may not exist in relay-log when orchestrator uses relay-log, so I want set relay_log_purge=0 and purge relay-log.
I made this tool to purge the relaylog safely, leaving the Pseudo-GTID.

License

MIT

Author

Motoaki Nishikawa (a.k.a. ichirin2501)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Configuration

type Configuration struct {
	Host              string
	Socket            string
	User              string
	Password          string
	Port              int
	DatabaseName      string
	PurgeDelaySeconds int
	ShowVersion       bool
	DryRun            bool
}

func ParseOptions

func ParseOptions(args []string) (*Configuration, error)

type Purger

type Purger struct {
	DelaySeconds int
	DryRun       bool
	// contains filtered or unexported fields
}

func NewPurger

func NewPurger(db *sqlx.DB, delay int, dryRun bool) *Purger

func (*Purger) HasPurgePrivilege

func (p *Purger) HasPurgePrivilege(ctx context.Context) (bool, error)

func (*Purger) Purge

func (p *Purger) Purge(ctx context.Context) error

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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