upload

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2018 License: GPL-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DockerJob

type DockerJob struct {
	UserData   interface{}
	ImageID    string
	Repository string
	Tag        string
}

DockerJob is a docker container upload job

func (*DockerJob) GetUserData

func (d *DockerJob) GetUserData() interface{}

GetUserData returns the UserData

func (*DockerJob) LocalPath

func (d *DockerJob) LocalPath() string

LocalPath returns the image id of the container

func (*DockerJob) RemoteDest

func (d *DockerJob) RemoteDest() string

RemoteDest returns the upload path in the docker registry

func (*DockerJob) SetUserData

func (d *DockerJob) SetUserData(u interface{})

SetUserData sets the UserData

func (*DockerJob) String

func (d *DockerJob) String() string

String returns the string representation

func (*DockerJob) Type

func (d *DockerJob) Type() JobType

Type returns the JobDocker

type DockerUploader

type DockerUploader interface {
	Upload(ctx context.Context, image, dest string) (string, error)
}

DockerUploader is an interface for docker uploader

type Job

type Job interface {
	LocalPath() string
	RemoteDest() string
	Type() JobType
	GetUserData() interface{}
	SetUserData(interface{})
	String() string
}

Job is the interface for upload jobs

type JobType

type JobType int

JobType describes the type of a job

const (

	// JobS3 is the type for S3 file upload jobs
	JobS3 JobType
	// JobDocker is the type for Docker container uploader jobs
	JobDocker
)

type Manager

type Manager interface {
	Add(Job)
	Start()
	Stop()
}

Manager is an interface for upload managers

type Result

type Result struct {
	Err      error
	URL      string
	Duration time.Duration
	Job      Job
}

Result result of an upload attempt

type S3Job

type S3Job struct {
	UserData interface{}
	FilePath string
	DestURL  string
}

S3Job is an upload jobs for files to S3 repositories

func (*S3Job) GetUserData

func (s *S3Job) GetUserData() interface{}

GetUserData returns the UserData

func (*S3Job) LocalPath

func (s *S3Job) LocalPath() string

LocalPath returns the local path of the file that is uploaded

func (*S3Job) RemoteDest

func (s *S3Job) RemoteDest() string

RemoteDest returns the path in S3

func (*S3Job) SetUserData

func (s *S3Job) SetUserData(u interface{})

SetUserData sets the UserData

func (*S3Job) String

func (s *S3Job) String() string

String returns the string representation

func (*S3Job) Type

func (s *S3Job) Type() JobType

Type returns JobS3

type S3Uploader

type S3Uploader interface {
	Upload(file, dest string) (string, error)
}

S3Uploader is an interface for S3 uploader

Directories

Path Synopsis
Package seq implements a simple Sequential Uploader.
Package seq implements a simple Sequential Uploader.

Jump to

Keyboard shortcuts

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