Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrSkipped = errors.New("repository skipped")
ErrSkipped means the repository was skipped because there was nothing to backup
Functions ¶
This section is empty.
Types ¶
type CreatePipeline ¶
type CreatePipeline interface { Create(context.Context, *CreateRequest) Done() error }
CreatePipeline is a pipeline that only handles creating backups
type CreateRequest ¶
type CreateRequest struct { Server storage.ServerInfo Repository *gitalypb.Repository }
CreateRequest is the request to create a backup
type Filesystem ¶
type Filesystem struct {
// contains filtered or unexported fields
}
Filesystem strategy for creating and restoring backups
func NewFilesystem ¶
func NewFilesystem(path string) *Filesystem
NewFilesystem creates a new Filesystem strategy
func (*Filesystem) Create ¶
func (fs *Filesystem) Create(ctx context.Context, req *CreateRequest) error
Create creates a repository backup on a local filesystem
func (*Filesystem) Restore ¶
func (fs *Filesystem) Restore(ctx context.Context, req *RestoreRequest) error
Restore restores a repository from a backup on a local filesystem
type ParallelCreatePipeline ¶
type ParallelCreatePipeline struct {
// contains filtered or unexported fields
}
ParallelCreatePipeline is a pipeline that creates backups in parallel
func NewParallelCreatePipeline ¶
func NewParallelCreatePipeline(next CreatePipeline, n int) *ParallelCreatePipeline
NewParallelCreatePipeline creates a new ParallelCreatePipeline where `next` is the pipeline called to create the backups and `n` is the number of parallel backups that will run.
func (*ParallelCreatePipeline) Create ¶
func (p *ParallelCreatePipeline) Create(ctx context.Context, req *CreateRequest)
Create queues a call to `next.Create` which will be run in parallel
func (*ParallelCreatePipeline) Done ¶
func (p *ParallelCreatePipeline) Done() error
Done waits for any in progress calls to `Create` to complete then reports any accumulated errors
type ParallelStorageCreatePipeline ¶ added in v14.1.0
type ParallelStorageCreatePipeline struct {
// contains filtered or unexported fields
}
ParallelStorageCreatePipeline is a pipeline that creates backups in parallel limited per storage
func NewParallelStorageCreatePipeline ¶ added in v14.1.0
func NewParallelStorageCreatePipeline(next CreatePipeline, n int) *ParallelStorageCreatePipeline
NewParallelStorageCreatePipeline creates a new ParallelStorageCreatePipeline where `next` is the pipeline called to create the backups and `n` is the number of parallel backups that will run per storage. Since the number of storages is unknown at initialisation, workers are created lazily as new storage names are encountered.
func (*ParallelStorageCreatePipeline) Create ¶ added in v14.1.0
func (p *ParallelStorageCreatePipeline) Create(ctx context.Context, req *CreateRequest)
Create queues a request to create a backup. Requests are processed by n-workers per storage.
func (*ParallelStorageCreatePipeline) Done ¶ added in v14.1.0
func (p *ParallelStorageCreatePipeline) Done() error
Done waits for any in progress calls to `Create` to complete then reports any accumulated errors
type Pipeline ¶
type Pipeline struct {
// contains filtered or unexported fields
}
Pipeline handles a series of requests to create/restore backups. Pipeline encapsulates error handling for the caller.
func NewPipeline ¶
func NewPipeline(log logrus.FieldLogger, strategy Strategy) *Pipeline
NewPipeline creates a new pipeline
func (*Pipeline) Create ¶
func (p *Pipeline) Create(ctx context.Context, req *CreateRequest)
Create requests that a repository backup be created
type RestoreRequest ¶
type RestoreRequest struct { Server storage.ServerInfo Repository *gitalypb.Repository AlwaysCreate bool }
RestoreRequest is the request to restore from a backup
type Strategy ¶
type Strategy interface { Create(context.Context, *CreateRequest) error Restore(context.Context, *RestoreRequest) error }
Strategy used to create/restore backups