backgroundfetcher

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 15, 2023 License: Apache-2.0 Imports: 12 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BackgroundFetcher

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

A backgroundFetcher is responsible for fetching spans from layers in the background.

func NewBackgroundFetcher

func NewBackgroundFetcher(opts ...Option) (*BackgroundFetcher, error)

func (*BackgroundFetcher) Add

func (bf *BackgroundFetcher) Add(resolver Resolver)

Add a new Resolver to be background fetched from. Sends the resolver through the channel, which will be received in the Run() method.

func (*BackgroundFetcher) Close

func (bf *BackgroundFetcher) Close() error

func (*BackgroundFetcher) Pause

func (bf *BackgroundFetcher) Pause()

Pause sends a signal to pause the background fetcher for silencePeriod on the next iteration.

func (*BackgroundFetcher) Run

func (bf *BackgroundFetcher) Run(ctx context.Context) error

type Option

type Option func(*BackgroundFetcher) error

func WithEmitMetricPeriod

func WithEmitMetricPeriod(period time.Duration) Option

func WithFetchPeriod

func WithFetchPeriod(period time.Duration) Option

func WithMaxQueueSize

func WithMaxQueueSize(size int) Option

func WithSilencePeriod

func WithSilencePeriod(period time.Duration) Option

type Resolver

type Resolver interface {
	// Resolve fetches and caches the next span. Returns true if there is still more data to be fetched.
	// Returns false otherwise.
	Resolve(context.Context) (bool, error)

	// Closes the resolver.
	Close() error

	// Checks whether the resolver is closed or not.
	Closed() bool
}

func NewSequentialResolver

func NewSequentialResolver(layerDigest digest.Digest, spanManager *sm.SpanManager) Resolver

Jump to

Keyboard shortcuts

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