providers

package
v0.0.0-...-9752724 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2014 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrorProviderNoSuch  = errors.New("[Provider] No Such Provider.")
	ErrorProviderInvalid = errors.New("[Provider] Provider Invalid.")
	ErrorProviderMissing = errors.New("[Provider] Please specifiy a provider.")

	ErrorLabelEmpty   = errors.New("[Provider] The Label is empty.")
	ErrorLabelInvalid = errors.New("[Provider] Invalid Label. Require 'provider:location package'")
)

Functions

func Provide

func Provide(uri string) (Provider, *Label, error)

func SetDefault

func SetDefault(uri string) error

Types

type Label

type Label struct {
	Location string
	Version  *semver.Version

	//If it is not the exact version requested for.
	Alt bool
}

type Provider

type Provider interface {

	//This method sets the location when it applies.
	//Return an error on invalid location, ignore if it
	//doesn't applies.
	SetLocation(string) error
	//This method parses a Label
	//into Locatoin and Version, returns an error if
	//invalid Label.
	Parse(string) (*Label, error)

	//Used for remote providers to update their repository list.
	//Providers MUST attempt to reconnect and only return an error if connection
	//fails after reasonable number of retrys.
	Update() error

	//List all packages, accepts a filter.
	Packages(string) ([]string, error)

	//List all version of a package, accepts a product name.
	Versions(string) ([]string, error)

	//Fetches a specific package.
	Fetch(*Label) (io.Reader, error)

	// Provides the location for the source of a specific version.
	// The location must be a location on the local file system, preferably under /tmp/ when possible.
	// It is the stevenhong: responsiblity of the provider to fetch and extract the source.
	Source(*Label) (string, error)
}

type S3

type S3 struct {
	Index struct {
		XMLNAME xml.Name `xml:"pre"`
		// contains filtered or unexported fields
	}
	// contains filtered or unexported fields
}

Name Versions

func (S3) Get

func (p S3) Get(filter string) []string

func (S3) SetLocation

func (p S3) SetLocation(location string) error

func (S3) Update

func (p S3) Update() error

Jump to

Keyboard shortcuts

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