downloaders

package
v0.0.0-...-9ef47f9 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2022 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DiscardWriteBuffer

type DiscardWriteBuffer struct {
}

func NewDiscardWriteBuffer

func NewDiscardWriteBuffer() *DiscardWriteBuffer

func (DiscardWriteBuffer) WriteAt

func (w DiscardWriteBuffer) WriteAt(p []byte, offset int64) (n int, err error)

type Downloader

type Downloader interface {
	Throughput() float64
	Start(ctx context.Context) error
}

type FileCopyJob

type FileCopyJob struct {
	Readpath string
	Filepath string
	Name     string
	Size     int64
}

type FilesystemDownload

type FilesystemDownload struct {
	Readpath    string
	Writepath   string
	Workers     uint
	Threads     uint
	Partsize    int64
	MaxList     int
	IsBenchmark bool
	Bar         *pb.ProgressBar
	Log         *logging.Logger
	StartTime   time.Time
}

func (*FilesystemDownload) Start

func (d *FilesystemDownload) Start(ctx context.Context) error

func (FilesystemDownload) Throughput

func (d FilesystemDownload) Throughput() float64

type HTTPClient

type HTTPClient interface {
	Do(*http.Request) (*http.Response, error)
}

type LogProgressWriteBuffer

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

func NewLogProgressWriteBuffer

func NewLogProgressWriteBuffer(bar *pb.ProgressBar, w io.WriterAt) *LogProgressWriteBuffer

func (LogProgressWriteBuffer) WriteAt

func (l LogProgressWriteBuffer) WriteAt(p []byte, offset int64) (n int, err error)

type MultiNicHTTPClient

type MultiNicHTTPClient struct {
	// List of NICs we're load balancing traffic across
	NICs []net.IP
	// contains filtered or unexported fields
}

func NewMultiNicHTTPClient

func NewMultiNicHTTPClient(nicNames []string) (*MultiNicHTTPClient, error)

func (*MultiNicHTTPClient) Client

func (mn *MultiNicHTTPClient) Client() *http.Client

*

  • From the go standard libraries http.Client docs:
  • The Client's Transport typically has internal state (cached TCP connections), so Clients should be reused instead of created as needed.
  • Clients are safe for concurrent use by multiple goroutines.

func (*MultiNicHTTPClient) Do

func (mn *MultiNicHTTPClient) Do(req *http.Request) (*http.Response, error)

Load balances traffic across the HTTP Clients

type PartCopyJob

type PartCopyJob struct {
	Source      *os.File
	Destination *os.File
	Offset      int64
}

type S3Download

type S3Download struct {
	Bucket      string
	Prefix      string
	Writepath   string
	Region      string
	Workers     uint
	Threads     uint
	Partsize    int64
	MaxList     int
	IsBenchmark bool
	NICs        []string
	Bar         *pb.ProgressBar
	Log         *logging.Logger
	StartTime   time.Time
}

func (*S3Download) Start

func (d *S3Download) Start(ctx context.Context) error

func (S3Download) Throughput

func (d S3Download) Throughput() float64

Jump to

Keyboard shortcuts

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