operator

package
v0.0.0-...-1f2b6da Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2017 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MaxPartitionSize represents the maximun size of a partition.
	MaxPartitionSize = 1610612736
	// MaxPartitionMembers represents the maximun numbers of menbers in a partition.
	MaxPartitionMembers = int(MaxPartitionSize / 262144)
)

Variables

This section is empty.

Functions

func Unite

func Unite(cluster string, partition io.ReadCloser) error

Unite untar a partition for the given directory.

Types

type Backup

type Backup struct {
	Name   string
	Offset string
}

Backup represents a backup.

type Database

type Database interface {
	StartBackup() (*Backup, error)
	StopBackup() (*Backup, error)
}

Database represents the underlying postgres database.

func NewDatabase

func NewDatabase(dsn string) (Database, error)

NewDatabase returns a new Database based on the given given data source.

type File

type File struct {
	Path     string
	Rel      string
	FileInfo os.FileInfo
}

File represents an archive file.

func (*File) String

func (f *File) String() string

String returns the path of a file.

type Operator

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

Operator contains all operations.

func NewOperator

func NewOperator(ssn string) (*Operator, error)

NewOperator creates a new operator.

func (*Operator) Archive

func (o *Operator) Archive(name string) error

Archive archives the given wal segment.

func (*Operator) Backup

func (o *Operator) Backup(cluster string, rate int) error

Backup backups the given cluster directory.

func (*Operator) Restore

func (o *Operator) Restore(cluster, name string) error

Restore a named backup to the given cluster directory.

func (*Operator) Unarchive

func (o *Operator) Unarchive(name string, dest string) error

Unarchive restore the given wal segment to the destination.

type Tape

type Tape []*File

Tape represents an archive.

func Partition

func Partition(cluster string) (tapes []Tape, err error)

Partition creates multiple tapes for the given directory.

func (Tape) Copy

func (t Tape) Copy(w io.WriteCloser) error

Copy writes a tar archive of all members.

Jump to

Keyboard shortcuts

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