seq

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2020 License: GPL-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package seq implements a simple Sequential Uploader. Upload jobs are processed sequentially in-order.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DockerUploader added in v0.17.0

type DockerUploader interface {
	Upload(image, registryAddr, repository, tag string) (string, error)
}

DockerUploader is a client for uploading docker images to a registry

type FileUploader added in v0.17.0

type FileUploader interface {
	Upload(from, to string) (string, error)
}

FileUploader is an interface for storing files in another place

type Logger

type Logger interface {
	Debugf(format string, v ...interface{})
}

Logger defines the logger interface

type Uploader

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

Uploader is a sequential uploader

func New

func New(logger Logger, filecopyUploader, s3Uploader FileUploader, dockerUploader DockerUploader, status chan<- *scheduler.Result) *Uploader

New initializes a sequential uploader Status chan must have a buffer count > 1 otherwise a deadlock occurs

func (*Uploader) Add

func (u *Uploader) Add(job scheduler.Job)

Add adds a new upload job, can be called after Start()

func (*Uploader) Start

func (u *Uploader) Start()

Start starts uploading jobs in the queue. If the statusChan buffer is full, uploading will be blocked.

func (*Uploader) Stop

func (u *Uploader) Stop()

Stop stops the uploader

Jump to

Keyboard shortcuts

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