spanmanager

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: Apache-2.0 Imports: 14 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrSpanNotAvailable    = errors.New("span not available in cache")
	ErrIncorrectSpanDigest = errors.New("span digests do not match")
	ErrExceedMaxSpan       = errors.New("span id larger than max span id")
)

Specific error types raised by SpanManager.

Functions

This section is empty.

Types

type MultiReaderCloser added in v0.4.0

type MultiReaderCloser struct {
	io.Reader
	// contains filtered or unexported fields
}

func (*MultiReaderCloser) Close added in v0.4.0

func (mrc *MultiReaderCloser) Close() error

type SectionReaderCloser added in v0.4.0

type SectionReaderCloser struct {
	*io.SectionReader
	// contains filtered or unexported fields
}

func (*SectionReaderCloser) Close added in v0.4.0

func (src *SectionReaderCloser) Close() error

type SpanManager

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

SpanManager fetches and caches spans of a given layer.

func New

func New(ztoc *ztoc.Ztoc, r *io.SectionReader, cache cache.BlobCache, retries int, cacheOpt ...cache.Option) *SpanManager

TODO: return errors/nil objects on failure

func (*SpanManager) Close

func (m *SpanManager) Close()

Close closes both the underlying zinfo data and blob cache.

func (*SpanManager) FetchSingleSpan

func (m *SpanManager) FetchSingleSpan(spanID compression.SpanID) error

FetchSingleSpan invokes the reader to fetch the span in the background and cache the span without uncompressing. It is invoked by the BackgroundFetcher. span state change: unrequested -> requested -> fetched.

func (*SpanManager) GetContents

func (m *SpanManager) GetContents(startUncompOffset, endUncompOffset compression.Offset) (io.ReadCloser, error)

GetContents returns a reader for the requested contents. The contents may be across multiple spans.

Jump to

Keyboard shortcuts

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