Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNoFactoryFound = errors.New("factory not found for url")
ErrNoFactoryFound is returned when there is no factory that can be used for a given URL.
View Source
var ErrNoRepoFound = errors.New("repo not found")
ErrNoRepoFound is returned when a factory cannot create a Repo for a given URL.
View Source
var ErrRepoInaccessible = errors.New("repo inaccessible")
ErrRepoInaccessible is returned when a the Repo may exist, but is unable to access the repository for some reason.
Functions ¶
This section is empty.
Types ¶
type Factory ¶
type Factory interface { // New returns a new instance of Repo for the supplied URL. // // If the project can not be found, the error NoRepoFound will be returned. // // If the project is not valid for use, or there is any other issue creating // the Repo, Repo will be nil and an error will be returned. New(context.Context, *url.URL) (Repo, error) // Match returns true if this factory can create a new instance of Repo // repository for the given repository URL. Match(*url.URL) bool }
Factory is used to obtain new instances of Repo.
type Resolver ¶
type Resolver struct {
// contains filtered or unexported fields
}
Resolver is used to resolve a Repo url against a set of Factory instances registered with the resolver.
func (*Resolver) Register ¶
Register adds the factory f to the set of factories that can be used for resolving a url to a Repo.
Click to show internal directories.
Click to hide internal directories.