mirror

package
v0.15.7 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2020 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package mirror implements the export file mirroring job.

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
	Storage               storage.Config

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

	// Max file sizes for download. 1mb for index files, 20mb for zip files.
	MaxIndexBytes int64 `env:"MAX_INDEX_BYTES, default=1048576"`
	MaxZipBytes   int64 `env:"MAX_ZIP_BYTES, default=20971520"`

	IndexFileDownloadTimeout  time.Duration `env:"INDEX_FILE_DOWNLOAD_TIMEOUT, default=30s"`
	ExportFileDownloadTimeout time.Duration `env:"EXPORT_FILE_DOWNLOAD_TIMEOUT, default=2m"`

	MaxRuntime         time.Duration `env:"MAX_RUNTIME, default=14m"`
	MirrorLockDuration time.Duration `env:"MIRROR_LOCK_DURATION, default=15m"`
}

func (*Config) BlobstoreConfig

func (c *Config) BlobstoreConfig() *storage.Config

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 FileStatus

type FileStatus struct {
	Order        int
	MirrorFile   *model.MirrorFile
	DownloadPath string
	Filename     string
	Failed       bool
	Saved        bool
}

type Server

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

Server hosts end points to manage key rotation

func NewServer

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

NewServer creates a Server that manages deletion of old export files that are no longer needed by clients for download.

func (*Server) Routes

func (s *Server) Routes(ctx context.Context) *http.ServeMux

Routes defines and returns the routes for this server.

Directories

Path Synopsis
Package database is a database interface for mirror settings.
Package database is a database interface for mirror settings.
Package model is a model abstraction of mirror data structures.
Package model is a model abstraction of mirror data structures.

Jump to

Keyboard shortcuts

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