cpan

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: May 12, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// APIRelease is the format string for the metacpan release API
	APIRelease = "https://fastapi.metacpan.org/v1/release/%s"
	// APIDownloadURL is the format string for the metacpan download_url API
	APIDownloadURL = "https://fastapi.metacpan.org/v1/download_url/%s"
)

Variables

View Source
var SearchRegex = regexp.MustCompile("https?://*(?:/.*cpan.org)(?:/CPAN)?/authors/id/(.+)$")

SearchRegex is the regexp for "search.cpan.org"

Functions

This section is empty.

Types

type APIModule added in v1.1.0

type APIModule struct {
	Module string `json:"main_module"`
}

APIModule holds the name of a Perl Module

type Provider

type Provider struct{}

Provider is the upstream provider interface for CPAN

func (Provider) Latest

func (c Provider) Latest(name string) (r *results.Result, s results.Status)

Latest finds the newest release for a CPAN package

func (Provider) Match

func (c Provider) Match(query string) string

Match checks to see if this provider can handle this kind of query

func (Provider) Name

func (c Provider) Name() string

Name gives the name of this provider

func (Provider) Releases

func (c Provider) Releases(name string) (rs *results.ResultSet, s results.Status)

Releases finds all matching releases for a CPAN package

type Release

type Release struct {
	Version  string `json:"version"`
	Status   string `json:"status"`
	Date     string `json:"date"`
	Location string `json:"download_url"`
	Error    string `json:"error"`
}

Release is a JSON representation of a CPAN release

func (*Release) Convert

func (cr *Release) Convert(name string) *results.Result

Convert turns a CPAN release into a Cuppa result

type Releases

type Releases struct {
	Releases []Release `json:"releases"`
}

Releases is a collection of CPAN releases

func (*Releases) Convert

func (crs *Releases) Convert(name string) *results.ResultSet

Convert turns Releases into a Cuppa ResultSet

Jump to

Keyboard shortcuts

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