copy

package
v0.0.0-...-c28e036 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2019 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MTIME_ATTR_NAME = "goog-reserved-file-mtime"
)

Variables

View Source
var (
	CRC32CTable = crc32.MakeTable(crc32.Castagnoli)
)

Functions

func NewCRC32UpdatingReader

func NewCRC32UpdatingReader(r io.Reader, currentCRC *uint32) io.Reader

NewCRC32UpdatingReader returns a CRC32UpdatingReader. 'currentCRC' is the starting crc32 value for the reader, and will be updated as bytes are read.

func NewResumableHttpClient

func NewResumableHttpClient(ctx context.Context, opts ...option.ClientOption) (*http.Client, error)

NewResumableHttpClient creates a new http.Client suitable for resumable copies.

func NewSemAcquiringReader

func NewSemAcquiringReader(r io.Reader, ctx context.Context) io.Reader

NewSemAcquiringReader returns a SemAcquiringReader. If Read concurrency is unlimited then this will return the passed in io.Reader.

Types

type BackOff

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

Backoff provides a back-off scheme for retrying events.

func (*BackOff) GetDelay

func (b *BackOff) GetDelay() (time.Duration, bool)

GetDelay returns a delay duration and bool indicating whether or not the caller should continue using the delay and retrying the event. Every iteration the delay grows exponentially up to the maxBackOffDelay.

type CRC32UpdatingReader

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

CRC32UpdatingReader is an io.Reader that wraps another io.Reader and a starting crc32c. This reader updates the crc32c as bytes are read.

func (*CRC32UpdatingReader) Read

func (cr *CRC32UpdatingReader) Read(buf []byte) (n int, err error)

Read implements the io.Reader interface.

type CopyHandler

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

CopyHandler is responsible for handling copy tasks.

func NewCopyHandler

func NewCopyHandler(storageClient *storage.Client, hc *http.Client, st *stats.Tracker) *CopyHandler

NewCopyHandler creates a CopyHandler with storage.Client and http.Client.

func (*CopyHandler) Do

func (h *CopyHandler) Do(ctx context.Context, taskReqMsg *taskpb.TaskReqMsg, reqStart time.Time) *taskpb.TaskRespMsg

type SemAcquiringReader

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

SemAcquiringReader is an io.Reader that wraps another io.Reader and limits the number of concurrent Read calls globally.

func (*SemAcquiringReader) Read

func (sar *SemAcquiringReader) Read(buf []byte) (n int, err error)

Read implements the io.Reader interface.

Jump to

Keyboard shortcuts

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