Help us shape the future of Go! Take the 2026 Go Developer Survey

logical

package
v3.0.4 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2025 License: AGPL-3.0 Imports: 36 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 DumpDefinition

type DumpDefinition struct {
	Tables      []string        `yaml:"tables"`
	Format      string          `yaml:"format"`
	Compression compressionType `yaml:"compression"`
	// contains filtered or unexported fields
}

DumpDefinition describes a database for dumping.

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, engineProps global.EngineProps) (*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"`
	ContainerConfig map[string]interface{}    `yaml:"containerConfig"`
	Connection      Connection                `yaml:"connection"`
	Source          Source                    `yaml:"source"`
	Databases       map[string]DumpDefinition `yaml:"databases"`
	ParallelJobs    int                       `yaml:"parallelJobs"`
	Restore         ImmediateRestore          `yaml:"immediateRestore"`
}

DumpOptions defines a logical dump options.

type ImmediateRestore

type ImmediateRestore struct {
	Enabled   bool              `yaml:"enabled"`
	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, engineProps global.EngineProps) (*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"`
	ContainerConfig map[string]interface{}    `yaml:"containerConfig"`
	Databases       map[string]DumpDefinition `yaml:"databases"`
	ForceInit       bool                      `yaml:"forceInit"`
	ParallelJobs    int                       `yaml:"parallelJobs"`
	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