base

package
v0.4.7 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2017 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultTimeFormat = "2006-01-02_15-04-05_Z0700"

	// From IANA Service Name and Transport Protocol Port Number Registry
	// This port is unregistered for now.
	// https://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml?&page=126
	DefaultPort = "24925"
)

Variables

View Source
var (
	NodeInfoKey = "nodes"

	BackupsKey = "backups"

	BackupInWeekKey = "backup_in_week"
)

Functions

func BackupBaseDBKey

func BackupBaseDBKey(db string, start string) string

func BackupDBKey

func BackupDBKey(db string) string

func BackupToNodeInWeek

func BackupToNodeInWeek(n string, week time.Weekday) string

func NewStoreDir

func NewStoreDir(v string) (string, error)

NewStoreDir returns an absolute path for value. This does not accept '~'.

func NodeInfo

func NodeInfo(n string) string

Types

type BackupType

type BackupType int
const (
	FULL BackupType = iota
	INC
	UNKNOWN
)

func ConvertToType

func ConvertToType(t string) BackupType

func (BackupType) String

func (t BackupType) String() string

type Config

type Config struct {
	// TimeFormat is used for a directory path
	TimeFormat string

	Host string

	Port string

	Addr string

	AdvertiseAddr string
}

func (*Config) InitDefaults

func (cfg *Config) InitDefaults()

type RestoreXtrabackupConfig

type RestoreXtrabackupConfig struct {
	XtrabackupBinPath   string
	InnobackupexBinPath string
	UseInnobackupex     bool
	IsLast              bool
	IncDir              string
	Parallel            int
	UseMemory           string
	DefaultsFile        string
}

type ServerConfig

type ServerConfig struct {
	*Config

	// StoreDir
	StoreDir *StoreSpec

	JoinAddr string

	EtcdPeerPort string

	Name string

	StatusSampleInterval time.Duration

	ServeRateLimit uint64
}

Config is a configuration for polymerase server.

func MakeServerConfig

func MakeServerConfig() *ServerConfig

MakeConfig creates a initial Config.

func (*ServerConfig) BackupsDir

func (cfg *ServerConfig) BackupsDir() string

BackupsDir returns a directory path for backup data.

func (*ServerConfig) EtcdDataDir

func (cfg *ServerConfig) EtcdDataDir() string

EtcdDataDir returns a directory path for etcd data dir.

func (*ServerConfig) LogsDir

func (cfg *ServerConfig) LogsDir() string

LogsDir returns a directory path for log.

func (*ServerConfig) TempDir

func (cfg *ServerConfig) TempDir() string

TempDir returns a directory path for temporary.

type StoreSpec

type StoreSpec struct {
	Path string
}

func (*StoreSpec) Set

func (ss *StoreSpec) Set(value string) error

func (*StoreSpec) String

func (ss *StoreSpec) String() string

func (*StoreSpec) Type

func (ss *StoreSpec) Type() string

type XtrabackupCheckpoints

type XtrabackupCheckpoints struct {
	BackupType        string `ini:"backup_type"`
	FromLSN           string `ini:"from_lsn"`
	ToLSN             string `ini:"to_lsn"`
	LastLSN           string `ini:"last_lsn"`
	Compact           int    `ini:"compact"`
	RecoverBinlogInfo int    `ini:"recover_binlog_info"`
}

XtrabackupCheckpoints is for reflection. xtrabackup_checkpoints is like this: ``` backup_type = incremental from_lsn = 100 to_lsn = 110 last_lsn = 120 compact = 0 recover_binlog_info = 0 ```

func LoadXtrabackupCP

func LoadXtrabackupCP(path string) XtrabackupCheckpoints

type XtrabackupConfig

type XtrabackupConfig struct {
	XtrabackupBinPath   string
	InnobackupexBinPath string
	Host                string
	Port                string
	User                string
	Password            string
	LsnTempDir          string
	ToLsn               string
	UseInnobackupex     bool
	InsecureAuth        bool
	Parallel            int
	UseMemory           string
	DefaultsFile        string
}

func MakeXtrabackupConfig

func MakeXtrabackupConfig() *XtrabackupConfig

Jump to

Keyboard shortcuts

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