config

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMissingJobName  = errors.New("job name is required")
	ErrMissingDBDsn    = errors.New("databse dsn is required")
	ErrMissingDBDriver = errors.New("databse driver is required")
)

Functions

This section is empty.

Types

type Dump

type Dump struct {
	Notifier struct {
		Slack []*slack.Slack `yaml:"slack"`
	} `yaml:"notifier"`
	Jobs []*Job `yaml:"jobs"`
}

func (*Dump) Validate

func (dump *Dump) Validate() error

type Job

type Job struct {
	Name        string   `yaml:"name"`
	DBDriver    string   `yaml:"dbdriver"`
	DBDsn       string   `yaml:"dbdsn"`
	Gzip        bool     `yaml:"gzip"`
	Unique      bool     `yaml:"unique"`
	SshHost     string   `yaml:"sshhost"`
	SshUser     string   `yaml:"sshuser"`
	SshKey      string   `yaml:"sshkey"`
	DumpOptions []string `yaml:"options"`
	Storage     struct {
		Local   []*local.Local     `yaml:"local"`
		S3      []*s3.S3           `yaml:"s3"`
		GDrive  []*gdrive.GDrive   `yaml:"gdrive"`
		Dropbox []*dropbox.Dropbox `yaml:"dropbox"`
	} `yaml:"storage"`
}

func NewJob

func NewJob(name, driver, dbDsn string, opts ...Option) *Job

func (*Job) ViaSsh

func (job *Job) ViaSsh() bool

type MultiCloser

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

func NewMultiCloser

func NewMultiCloser(closers []io.Closer) *MultiCloser

func (*MultiCloser) Close

func (m *MultiCloser) Close() error

type Option

type Option func(job *Job)

func WithDumpOptions

func WithDumpOptions(dumpOptions ...string) Option

func WithGzip

func WithGzip(gzip bool) Option

func WithSshHost

func WithSshHost(sshHost string) Option

func WithSshKey

func WithSshKey(sshKey string) Option

func WithSshUser

func WithSshUser(sshUser string) Option

Jump to

Keyboard shortcuts

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