Documentation
¶
Index ¶
Constants ¶
View Source
const ( // DiscoveryQueryParam is the query parameter that is appended to URLs to signal the request is looking for // repository information. DiscoveryQueryParam = "spread-get=1" // DiscoveryMetaName is the the 'name' of the <meta> tag that contains Spread package information. DiscoveryMetaName = "spread-ref" // DefaultDomain is the domain assumed for packages if one is not given. DefaultDomain = "redspread.com" // DefaultNamespace is the namespace used if no domain and namespace is given. DefaultNamespace = "library" // DomainRegexpStr is a regular expression string to validate domains. DomainRegexpStr = "^([a-z0-9]+(-[a-z0-9]+)*\\.)+[a-z]{2,}$" )
Variables ¶
This section is empty.
Functions ¶
func ExpandPackageName ¶
ExpandPackageName returns a retrievable package name for packageName by adding the Redspread domain where a domain isn't specified.
Types ¶
type PackageInfo ¶
type PackageInfo struct {
// Prefix is the package contained in the repo. It should be an exact match or prefix to the requested package name.
Prefix string
// RepoURL is the location of the repository where package data is stored.
RepoURL string
}
PackageInfo contains the data retrieved in the discovery process.
func DiscoverPackage ¶
func DiscoverPackage(packageName string, insecure, verbose bool) (PackageInfo, error)
DiscoverPackage uses the package name to fetch a Spread URL to the repository. Set insecure when HTTP is allowed. Verbose will print information to STDOUT.
Click to show internal directories.
Click to hide internal directories.