Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Batcher ¶
type Batcher struct {
// contains filtered or unexported fields
}
Batcher issues batch items related to a single stream. It aggregates information about the stream required by callers to commit the stream. It also learns the stream ID (unless already provided for part uploads) and automatically injects it into batch items that need it.
func New ¶
func New(miBatcher metaclient.Batcher, streamID storj.StreamID) *Batcher
New returns a new Batcher that issues batch items for a stream. The streamID can be nil (in the case of an object upload) or not (in the case of a part upload). The batcher will discover the streamID in the former case when it processes a BeginObject.
func (*Batcher) Batch ¶
func (s *Batcher) Batch(ctx context.Context, batchItems ...metaclient.BatchItem) ([]metaclient.BatchResponse, error)
Batch issues batch items for a stream. Once the streamID is known, it will be injected into batch items that need it. If a BeginObject is issued, the stream ID will be gleaned from it. If a BeginObject needs to be issued, it must be the first batch item issued by the batcher.
type Info ¶
type Info struct { // CreationDate is the creation date of the stream extracted by the // stream ID that is provided to the Batcher or gathered from the // BeginObject response. CreationDate time.Time // PlainSize is the plain-text size of the stream aggregated from all // MakeInlineSegment or CommitSegment batch items. PlainSize int64 // Version is object version retrieved from CommitObject batch item. Version []byte }
Info returns stream information gathered by the Batcher.