logical

package
v2.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2021 License: AGPL-3.0 Imports: 30 Imported by: 0

Documentation

Overview

Package logical provides jobs for logical initial operations.

Package logical provides jobs for logical initial operations.

Index

Constants

View Source
const (
	// DumpJobType declares a job type for logical dumping.
	DumpJobType = "logicalDump"
)
View Source
const (
	// RestoreJobType declares a job type for logical dumping.
	RestoreJobType = "logicalRestore"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Connection

type Connection struct {
	Host     string `yaml:"host"`
	Port     int    `yaml:"port"`
	DBName   string `yaml:"dbname"`
	Username string `yaml:"username"`
	Password string `yaml:"password"`
}

Connection provides connection options.

type DumpJob

type DumpJob struct {
	DumpOptions
	// contains filtered or unexported fields
}

DumpJob declares a job for logical dumping.

func NewDumpJob

func NewDumpJob(jobCfg config.JobConfig, global *global.Config) (*DumpJob, error)

NewDumpJob creates a new DumpJob.

func (*DumpJob) Name

func (d *DumpJob) Name() string

Name returns a name of the job.

func (*DumpJob) Reload

func (d *DumpJob) Reload(cfg map[string]interface{}) (err error)

Reload reloads job configuration.

func (*DumpJob) Run

func (d *DumpJob) Run(ctx context.Context) (err error)

Run starts the job.

type DumpOptions

type DumpOptions struct {
	DumpLocation string            `yaml:"dumpLocation"`
	DockerImage  string            `yaml:"dockerImage"`
	Connection   Connection        `yaml:"connection"`
	Source       Source            `yaml:"source"`
	Partial      Partial           `yaml:"partial"`
	ParallelJobs int               `yaml:"parallelJobs"`
	Restore      *ImmediateRestore `yaml:"immediateRestore,omitempty"`
}

DumpOptions defines a logical dump options.

type ImmediateRestore

type ImmediateRestore struct {
	ForceInit bool              `yaml:"forceInit"`
	Configs   map[string]string `yaml:"configs"`
}

ImmediateRestore contains options for direct data restore without saving the dump file on disk.

type Partial

type Partial struct {
	Tables []string `yaml:"tables"`
}

Partial defines tables and rules for a partial logical restore.

type RDSConfig

type RDSConfig struct {
	AWSRegion   string `yaml:"awsRegion"`
	DBInstance  string `yaml:"dbInstanceIdentifier"`
	SSLRootCert string `yaml:"sslRootCert"`
}

RDSConfig describes configuration of an RDS instance.

type RestoreJob

type RestoreJob struct {
	RestoreOptions
	// contains filtered or unexported fields
}

RestoreJob defines a logical restore job.

func NewJob

func NewJob(cfg config.JobConfig, global *global.Config) (*RestoreJob, error)

NewJob create a new logical restore job.

func (*RestoreJob) Name

func (r *RestoreJob) Name() string

Name returns a name of the job.

func (*RestoreJob) Reload

func (r *RestoreJob) Reload(cfg map[string]interface{}) (err error)

Reload reloads job configuration.

func (*RestoreJob) Run

func (r *RestoreJob) Run(ctx context.Context) (err error)

Run starts the job.

type RestoreOptions

type RestoreOptions struct {
	DumpLocation string            `yaml:"dumpLocation"`
	DockerImage  string            `yaml:"dockerImage"`
	DBName       string            `yaml:"dbname"`
	ForceInit    bool              `yaml:"forceInit"`
	ParallelJobs int               `yaml:"parallelJobs"`
	Partial      Partial           `yaml:"partial"`
	Configs      map[string]string `yaml:"configs"`
}

RestoreOptions defines a logical restore options.

type Source

type Source struct {
	Type       string     `yaml:"type"`
	Connection Connection `yaml:"connection"`
	RDS        *RDSConfig `yaml:"rdsIam"`
}

Source describes source of data to dump.

Jump to

Keyboard shortcuts

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