client

package
v0.0.0-...-9742f5a Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2020 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BundleOutcome

type BundleOutcome struct {
	Outcome     Outcome
	ChunkOffset uint64
	Chunks      uint64
	// Bundle carries a deferred bundle which the client is not ready to process yet
	Bundle *fetchGroup
}

BundleOutcome is used to track successful decryption and handling of bundles. It is ok to fail to send a failed outcome if the context is cancelled; it is not ok to fail to sent an Ok outcome - read ahead and completion tracking is based around successful outcome notifications.

type Client

type Client interface {
	GetObject(ctx context.Context, name string, output chan *OutputChunk)
	Close(ctx context.Context) error
}

Client provides a simple interface to retrieve files from the network.

func New

func New(l *logrus.Logger, addr string, insecure bool) (Client, error)

New creates a new client connecting to the supplied publisher with a lazy-connecting grpc client.

type DownloadResult

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

type Outcome

type Outcome int

Outcome is used to signal what the outcome of the client handling of a bundle was.

const (
	// Completed indicates the bundle has been handled by the client
	Completed Outcome = iota
	// Deferred indicates the bundle cannot be handled yet (e.g. the client has requested a retry
	// and is waiting for the retried bundle to arrive)
	Deferred
	// Retry indicates that the bundle was corrupt in some fashion and should be retried (this covers
	// all manner of faults - bad cache connections, bad data from a cache, bad
	// tickets etc).
	Retry
)

type OutputChunk

type OutputChunk struct {
	Data []byte
	Err  error
}

OutputChunk contains either some ready to use bytes or an error.

Jump to

Keyboard shortcuts

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