backup

package
v0.28.0 Latest Latest
Warning

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

Go to latest
Published: May 7, 2021 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Overview

Package backup implements periodic backups.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Database              database.Config
	ObservabilityExporter observability.Config
	SecretManager         secrets.Config

	Port string `env:"PORT, default=8080"`

	// MinTTL is the minimum amount of time that must elapse between attempting
	// backups. This is used to control whether the pull is actually attempted at
	// the controller layer, independent of the data layer. In effect, it rate
	// limits the number of requests.
	MinTTL time.Duration `env:"BACKUP_MIN_PERIOD, default=5m"`

	// Timeout is the maximum amount of time to wait for a backup operation to
	// complete.
	Timeout time.Duration `env:"BACKUP_TIMEOUT, default=10m"`

	// Bucket is the name of the Cloud Storage bucket where backups should be
	// stored.
	Bucket string `env:"BACKUP_BUCKET, required"`

	// DatabaseInstanceURL is the full self-link of the URL to the SQL instance.
	DatabaseInstanceURL string `env:"BACKUP_DATABASE_INSTANCE_URL, required"`

	// DatabaseName is the name of the database to backup.
	DatabaseName string `env:"BACKUP_DATABASE_NAME, required"`
}

Config represents the configuration and associated environment variables for the cleanup components.

func (*Config) DatabaseConfig

func (c *Config) DatabaseConfig() *database.Config

func (*Config) ObservabilityExporterConfig

func (c *Config) ObservabilityExporterConfig() *observability.Config

func (*Config) SecretManagerConfig

func (c *Config) SecretManagerConfig() *secrets.Config

type Server

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

func NewServer

func NewServer(config *Config, env *serverenv.ServerEnv) (*Server, error)

func (*Server) Routes

func (s *Server) Routes(ctx context.Context) *mux.Router

Routes defines and returns the routes for this server.

Jump to

Keyboard shortcuts

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