Documentation ¶
Overview ¶
Package stream implements a single-pass streaming v1.Layer.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNotComputed is returned when the requested value is not yet // computed because the stream has not been consumed yet. ErrNotComputed = errors.New("value not computed until stream is consumed") // ErrConsumed is returned by Compressed when the underlying stream has // already been consumed and closed. ErrConsumed = errors.New("stream was already consumed") )
Functions ¶
This section is empty.
Types ¶
type Layer ¶
type Layer struct {
// contains filtered or unexported fields
}
Layer is a streaming implementation of v1.Layer.
func NewLayer ¶
func NewLayer(rc io.ReadCloser, opts ...LayerOption) *Layer
NewLayer creates a Layer from an io.ReadCloser.
func (*Layer) Compressed ¶
func (l *Layer) Compressed() (io.ReadCloser, error)
Compressed implements v1.Layer.
func (*Layer) Uncompressed ¶
func (l *Layer) Uncompressed() (io.ReadCloser, error)
Uncompressed implements v1.Layer.
type LayerOption ¶
type LayerOption func(*Layer)
LayerOption applies options to layer
func WithCompressionLevel ¶
func WithCompressionLevel(level int) LayerOption
WithCompressionLevel sets the gzip compression. See `gzip.NewWriterLevel` for possible values.
func WithMediaType ¶ added in v0.12.0
func WithMediaType(mt types.MediaType) LayerOption
WithMediaType is a functional option for overriding the layer's media type.
Click to show internal directories.
Click to hide internal directories.