services

package
v0.0.0-...-0207d7b Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GiteaAppPath = "/app/gitea/gitea"

GiteaAppPath points to the gitea binary location

View Source
var MysqlCmdApp = "/usr/bin/mysql"

MysqlCmdApp points to the mysql binary location

View Source
var MysqlDumpApp = "/usr/bin/mysqldump"

MysqlDumpApp points to the mysqldump binary location

View Source
var PostgresBinaryPath = "/usr/bin"

PostgresBinaryPath points to the location where the postgres binaries are located

Functions

This section is empty.

Types

type BackupResult

type BackupResult struct {
	DirPrefix  string
	NamePrefix string
	Path       string
}

type BackupResults

type BackupResults struct {
	Entries []BackupResult
}

type CmdConfig

type CmdConfig struct {
	Env        []string
	InputFile  io.Reader
	OutputFile io.Writer
	Credential *syscall.Credential
	CensorArg  string
	WorkDir    string
}

CmdConfig has the configuration needed to run an external executable

func (*CmdConfig) CmdRun

func (app *CmdConfig) CmdRun(name string, arg ...string) error

CmdRun executes an external executable

type GiteaConfig

type GiteaConfig struct {
	ConfigPath string
	DataPath   string
	SaveDir    string
}

GiteaConfig has the config options for the GiteaConfig service

func (*GiteaConfig) Backup

func (g *GiteaConfig) Backup() (*BackupResults, error)

Backup generates a tarball of the GiteaConfig repositories and returns the path where is stored

func (*GiteaConfig) Restore

func (g *GiteaConfig) Restore(_ string) error

Restore takes a GiteaConfig backup and restores it to the service

type MySQLConfig

type MySQLConfig struct {
	Host             string
	Port             string
	User             string
	Password         string
	Database         string
	NamePrefix       string
	NameAsPrefix     bool
	Options          string
	Compress         bool
	SaveDir          string
	SplitDatabases   bool
	ExcludeDatabases []string
	IgnoreExitCode   bool
}

MySQLConfig has the config options for the MySQLConfig service

func (*MySQLConfig) Backup

func (m *MySQLConfig) Backup() (*BackupResults, error)

Backup generates a dump of the database and returns the path where is stored

func (*MySQLConfig) Restore

func (m *MySQLConfig) Restore(filepath string) error

Restore takes a database dump and restores it

type PostgresConfig

type PostgresConfig struct {
	Host             string
	Port             string
	User             string
	Password         string
	Database         string
	NamePrefix       string
	NameAsPrefix     bool
	Options          string
	Compress         bool
	Custom           bool
	SaveDir          string
	IgnoreExitCode   bool
	Drop             bool
	Owner            string
	ExcludeDatabases []string
	BackupPerUser    bool
	BackupUsers      []string
	ExcludeUsers     []string
	BackupPerSchema  bool
	BackupSchemas    []string
	ExcludeSchemas   []string
	Version          string
}

PostgresConfig has the config options for the PostgresConfig service

func (*PostgresConfig) Backup

func (p *PostgresConfig) Backup() (*BackupResults, error)

func (*PostgresConfig) Restore

func (p *PostgresConfig) Restore(filepath string) error

Restore takes a database dump and restores it

type Service

type Service interface {
	Backup() (*BackupResults, error)
	Restore(path string) error
}

Service represents the methods to backup/restore a service

type TarballConfig

type TarballConfig struct {
	Name         string
	Path         string
	Compress     bool
	SaveDir      string
	Prefix       string
	BackupPerDir bool
	BackupDirs   []string
	ExcludeDirs  []string
}

TarballConfig has the config options for the TarballConfig service

func (*TarballConfig) Backup

func (f *TarballConfig) Backup() (*BackupResults, error)

Backup creates a tarball of the specified directory

func (*TarballConfig) Restore

func (f *TarballConfig) Restore(filepath string) error

Restore extracts a tarball to the specified directory

Jump to

Keyboard shortcuts

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