provider

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotSupport  = Error(errors.New("provider not support"))
	ErrNotFound    = Error(errors.New("uri not found"))
	ErrNoPing      = Error(errors.New("provider does not ping"))
	ErrEndOfReport = Error(errors.New("end of report"))
	ErrNoPkg       = Error(errors.New("no pkg"))
)

Functions

This section is empty.

Types

type Error

type Error error

type Provider

type Provider interface {
	// ProviderName is the provider name.
	ProviderName() string

	// Open creates Repo with the web url.
	// Note: It is assumed Ping check is done before calling Open.
	Open(url string) (Repo, error)

	// Parse creates Repo with the pkguri format url.
	Parse(uri string) (Repo, error)

	// Ping reports whether the url is supported by the provider.
	Ping(url string) error
}

Provider is the interface that must be implemented by a monler provider.

type Repo

type Repo interface {
	// Analyze creates Report.
	Analyze() (Report, error)

	// Derived returns urls which are related.
	Derived() ([]string, error)

	// Close closes and frees up resources.
	Close() error
}

Repo is the interface of a repo.

type Report

type Report interface {
	// Stringer returns string in pkguri format.
	fmt.Stringer

	// URI returns PkgURI.
	URI() (*pkguri.PkgURI, error)

	// Pkg holds the completed profile of the package.
	Pkg() (*model.Pkg, error)

	// Stats contains list of stats other than tag.
	Stats() ([]*model.Stat, error)

	// Next reports there has next tag.
	Next() bool

	// Tag returns the tag at the cursor.
	Tag() (*model.Stat, error)

	// Close closes and frees up resources.
	Close() error
}

Report contains the analyzed data from repo.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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