html

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: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ArchiveRegex = regexp.MustCompile("^(.+)-(.*)\\.(?:tar\\.[^.]+|zip)$")

ArchiveRegex matches archive filenames

View Source
var HTTPDConfig = Config{
	Location: LocationConfig{
		Index:   1,
		XML:     true,
		Pattern: regexp.MustCompile(">(.+)<"),
	},
	Modified: TimeConfig{
		Index:  2,
		Layout: "2006-01-02 15:04",
	},
}

HTTPDConfig is a configuration for a standard Apache httpd directory listing

Functions

This section is empty.

Types

type Config

type Config struct {
	Location LocationConfig
	Modified TimeConfig
}

Config is a configuration for parsing a listing

func (Config) Parse

func (c Config) Parse(name, path string, in io.Reader) (rs *results.ResultSet, err error)

Parse reads an HTML file listing and converts is to a ResultSet

type DownloadList

type DownloadList struct {
	Name  xml.Name
	Entry []struct {
		Columns []struct {
			XML string `xml:",innerxml"`
			Raw string `xml:",chardata"`
		} `xml:"td"`
	} `xml:"body>table>tr"`
}

DownloadList represents an HTML file listing

type LocationConfig

type LocationConfig struct {
	Index   int
	XML     bool
	Pattern *regexp.Regexp
}

LocationConfig is a configuration for the Location field in the listing

type Provider

type Provider struct{}

Provider is the upstream provider interface for HTML

func (Provider) Latest

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

Latest finds the newest release for a GNOME 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 rubygems package

type TimeConfig

type TimeConfig struct {
	Index  int
	Layout string
}

TimeConfig is a configuration for the Modified field in the listing

type Upstream

type Upstream struct {
	Name        string
	HostPattern *regexp.Regexp
	Conf        Config
}

Upstream pairs a Source matching Regex with a Config

func (Upstream) Match

func (u Upstream) Match(path string) string

Match checks if the provided path matches HostPattern

func (Upstream) Parse

func (u Upstream) Parse(name string, in io.Reader) (*results.ResultSet, error)

Parse reads a directory listing for a given path and Upstream

Jump to

Keyboard shortcuts

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