fetcher

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2023 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Overview

Package fetcher contains the implementations of fetchers to retrieve current versions for the catalog entries

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNoVersionFound signalizes the fetcher was not able to retrieve a version
	ErrNoVersionFound = errors.New("no version found")
)

Functions

This section is empty.

Types

type AtlassianFetcher

type AtlassianFetcher struct{}

AtlassianFetcher implements the fetcher interface to monitor Atlassian products

func (AtlassianFetcher) FetchVersion

FetchVersion retrieves the latest version for the catalog entry

Links retrieves a collection of links for the fetcher

func (AtlassianFetcher) Validate

Validate validates the configuration given to the fetcher

type Create

type Create func() Fetcher

Create represents a function to instantiate a Fetcher

type Fetcher

type Fetcher interface {
	// FetchVersion retrieves the latest version for the catalog entry
	FetchVersion(ctx context.Context, attrs *fieldcollection.FieldCollection) (string, time.Time, error)
	// Links retrieves a collection of links for the fetcher
	Links(attrs *fieldcollection.FieldCollection) []database.CatalogLink
	// Validate validates the configuration given to the fetcher
	Validate(attrs *fieldcollection.FieldCollection) error
}

Fetcher defines the interface all fetchers have to follow

func Get

func Get(name string) Fetcher

Get retrieves an creation function for the given fetcher name

type GitTagFetcher

type GitTagFetcher struct{}

GitTagFetcher implements the fetcher interface to monitor tags in a git repository

func (GitTagFetcher) FetchVersion

FetchVersion retrieves the latest version for the catalog entry

Links retrieves a collection of links for the fetcher

func (GitTagFetcher) Validate

Validate validates the configuration given to the fetcher

type GithubReleaseFetcher

type GithubReleaseFetcher struct{}

GithubReleaseFetcher implements the fetcher interface to monitor releases in a Github repository

func (GithubReleaseFetcher) FetchVersion

FetchVersion retrieves the latest version for the catalog entry

Links retrieves a collection of links for the fetcher

func (GithubReleaseFetcher) Validate

Validate validates the configuration given to the fetcher

type HTMLFetcher

type HTMLFetcher struct{}

HTMLFetcher implements the fetcher interface to monitor versions on websites by xpath queries

func (HTMLFetcher) FetchVersion

FetchVersion retrieves the latest version for the catalog entry

Links retrieves a collection of links for the fetcher

func (HTMLFetcher) Validate

Validate validates the configuration given to the fetcher

type JSONFetcher

type JSONFetcher struct{}

JSONFetcher implements the fetcher interface to retrieve a version from a JSON document

func (JSONFetcher) FetchVersion

FetchVersion retrieves the latest version for the catalog entry

Links retrieves a collection of links for the fetcher

func (JSONFetcher) Validate

Validate validates the configuration given to the fetcher

type RegexFetcher

type RegexFetcher struct{}

RegexFetcher implements the fetcher interface to monitor versions on a web request by regex

func (RegexFetcher) FetchVersion

FetchVersion retrieves the latest version for the catalog entry

Links retrieves a collection of links for the fetcher

func (RegexFetcher) Validate

Validate validates the configuration given to the fetcher

Jump to

Keyboard shortcuts

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