providers

package
v0.19.1 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2023 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidProvider = errors.New("invalid provider")

Functions

This section is empty.

Types

type FetchOpts

type FetchOpts struct {
	All            bool
	PackagePath    string
	SkipPatchCheck bool
}

type File

type File struct {
	Data        io.Reader
	Name        string
	Hash        hash.Hash
	Version     string
	Length      int64
	PackagePath string
}

type Provider

type Provider interface {
	// Fetch returns the file metadata to retrieve a specific binary given
	// for a provider
	Fetch(*FetchOpts) (*File, error)
	// GetLatestVersion returns the version and the URL of the
	// latest version for this binary
	GetLatestVersion() (string, string, error)

	// GetID returns the unique identiifer of this provider
	GetID() string
}

func New

func New(u, provider string) (Provider, error)

Jump to

Keyboard shortcuts

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