Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var GiteaAppPath = "/app/gitea/gitea"
GiteaAppPath points to the gitea binary location
var MysqlCmdApp = "/usr/bin/mysql"
MysqlCmdApp points to the mysql binary location
var MysqlDumpApp = "/usr/bin/mysqldump"
MysqlDumpApp points to the mysqldump binary location
var PostgresBinaryPath = "/usr/bin"
PostgresBinaryPath points to the location where the postgres binaries are located
Functions ¶
This section is empty.
Types ¶
type BackupResult ¶
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
type GiteaConfig ¶
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