registry

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package registry handles interaction with the C3PM registry. It handles file downloading and version querying.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FetchPackage

func FetchPackage(dependency string, version string, options Options) (*os.File, error)

FetchPackage downloads a package given it's name and version number.

func GetLastVersion

func GetLastVersion(dependency string, options Options) (*semver.Version, error)

GetLastVersion calls the registry to find the latest version published to the API. The version found can be different to the version that has been published to the API in case of support of ancient versions. For example, if a package is currently at version 3.3.0, but the maintainer last pushed version 2.7.3, a patch for version 2.7. The version returned by GetLastVersion will be 3.3.0, because it is the highest SemVer version number.

func SendMetric added in v0.3.0

func SendMetric(dependency string) error

Types

type ListRegistryResponse

type ListRegistryResponse struct {
	Name     string
	Contents []struct {
		Key string `xml:"Key"`
	} `xml:"Contents"`
}

ListRegistryResponse is the representation of the XML structure returned by the registry.

type Options

type Options struct {
	//RegistryURL is the URL to call to reach the registry.
	RegistryURL string
}

Options holds the options to pass to every function interacting with the registry

Jump to

Keyboard shortcuts

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