search

package
v0.5.4 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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

Search is the implementation for the searching and caching of image URLs.

func New

func New(log *logrus.Entry, cacheTimeout time.Duration, versionGetter *version.Version) *Search

New creates a new Search for querying searches over image tags

func (*Search) Fetch

func (s *Search) Fetch(ctx context.Context, imageURL string, opts *api.Options) (interface{}, error)

func (*Search) LatestImage

func (s *Search) LatestImage(ctx context.Context, imageURL string, opts *api.Options) (*api.ImageTag, error)

LatestImage will get the latestImage image given an image URL and options. If not found in the cache, or is too old, then will do a fresh lookup and commit to the cache.

func (*Search) Run

func (s *Search) Run(refreshRate time.Duration)

Run will run the search and image cache garbage collectors.

type Searcher

type Searcher interface {
	Run(time.Duration)
	LatestImage(context.Context, string, *api.Options) (*api.ImageTag, error)
}

Searcher is the interface for Search to facilitate testing

Jump to

Keyboard shortcuts

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