transport

package
v0.0.0-...-c9abf0a Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2016 License: BSD-3-Clause Imports: 6 Imported by: 2

Documentation

Index

Constants

View Source
const MULTIPART_CHUNK_SIZE = 8 * 1024 * 1024

Variables

View Source
var ErrProgressCompleted error = errors.New("Progress done")

Functions

This section is empty.

Types

type Blob

type Blob struct {
	Hash string
}

func NewBlob

func NewBlob(hash string) Blob

func (Blob) Path

func (self Blob) Path() string

type ProgressMessage

type ProgressMessage struct {
	Progress int
	Total    int
	Err      error
}

func NewProgressMessage

func NewProgressMessage(progress int, total int, err error) ProgressMessage

func (ProgressMessage) IsCompleted

func (self ProgressMessage) IsCompleted() bool

func (ProgressMessage) IsErrored

func (self ProgressMessage) IsErrored() bool

type ProgressWriter

type ProgressWriter struct {
	ProgressChan chan ProgressMessage
	Progress     uint64
	Total        uint64
}

func NewProgressWriter

func NewProgressWriter(progressChan chan ProgressMessage, total uint64) *ProgressWriter

func (*ProgressWriter) Write

func (self *ProgressWriter) Write(p []byte) (n int, err error)

type S3Transport

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

func NewS3Transport

func NewS3Transport(bucket *s3.Bucket) S3Transport

func (S3Transport) Download

func (self S3Transport) Download(blob Blob) chan ProgressMessage

func (S3Transport) Exists

func (self S3Transport) Exists(blob Blob) (bool, error)

func (S3Transport) Upload

func (self S3Transport) Upload(blob Blob) chan ProgressMessage

type Transport

type Transport interface {
	Upload(blob Blob) chan ProgressMessage
	Download(blob Blob) chan ProgressMessage
	Exists(blob Blob) (bool, error)
}

Jump to

Keyboard shortcuts

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