Documentation ¶
Index ¶
- type ErrCheckout
- type ErrClone
- type ErrNoRootOyafile
- type ErrNoTaggedVersions
- type ErrNotGithub
- type GithubRepo
- func (l *GithubRepo) AvailableVersions() ([]semver.Version, error)
- func (l *GithubRepo) ImportPath() types.ImportPath
- func (l *GithubRepo) Install(version semver.Version, installDir string) error
- func (l *GithubRepo) InstallPath(version semver.Version, installDir string) string
- func (l *GithubRepo) IsInstalled(version semver.Version, installDir string) (bool, error)
- func (l *GithubRepo) LatestVersion() (pack.Pack, error)
- func (l *GithubRepo) Reqs(version semver.Version) ([]pack.Pack, error)
- func (l *GithubRepo) Version(version semver.Version) (pack.Pack, error)
- Bugs
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ErrCheckout ¶
type ErrCheckout struct { ImportPath types.ImportPath ImportVersion semver.Version }
ErrCheckout indicates problem during repository checkout for ex. unknown version
func (ErrCheckout) Error ¶
func (err ErrCheckout) Error() string
type ErrClone ¶
type ErrClone struct {
RepoUrl string
}
ErrClone indacates problem during repository clone (doesn't exist or private)
type ErrNoRootOyafile ¶
type ErrNoRootOyafile struct { ImportPath types.ImportPath Version semver.Version }
ErrNoRootOyafile indicates that pack's root Oyafile is missing.
func (ErrNoRootOyafile) Error ¶
func (err ErrNoRootOyafile) Error() string
type ErrNoTaggedVersions ¶
type ErrNoTaggedVersions struct {
ImportPath types.ImportPath
}
ErrNoTaggedVersions indicates there are no available remote versions of the pack.
func (ErrNoTaggedVersions) Error ¶
func (err ErrNoTaggedVersions) Error() string
type ErrNotGithub ¶
type ErrNotGithub struct {
ImportPath types.ImportPath
}
ErrNotGithub indicates that the import path doesn't start with github.com.
func (ErrNotGithub) Error ¶
func (err ErrNotGithub) Error() string
type GithubRepo ¶
type GithubRepo struct {
// contains filtered or unexported fields
}
GithubRepo represents all versions of an Oya pack stored in a git repository on Github.com.
func Open ¶
func Open(importPath types.ImportPath) (*GithubRepo, error)
Open opens a library containing all versions of a single Oya pack.
func (*GithubRepo) AvailableVersions ¶
func (l *GithubRepo) AvailableVersions() ([]semver.Version, error)
AvailableVersions returns a sorted list of remotely available pack versions.
func (*GithubRepo) ImportPath ¶
func (l *GithubRepo) ImportPath() types.ImportPath
ImportPath returns the pack's import path, e.g. github.com/tooploox/oya-packs/docker.
func (*GithubRepo) Install ¶
func (l *GithubRepo) Install(version semver.Version, installDir string) error
Install downloads & copies the specified version of the path to the output directory, preserving its import path. For example, for /home/bilus/.oya output directory and import path github.com/bilus/foo, the pack will be extracted to /home/bilus/.oya/github.com/bilus/foo.
func (*GithubRepo) InstallPath ¶
func (l *GithubRepo) InstallPath(version semver.Version, installDir string) string
InstallPath returns the local path for the specific pack version.
func (*GithubRepo) IsInstalled ¶
func (*GithubRepo) LatestVersion ¶
func (l *GithubRepo) LatestVersion() (pack.Pack, error)
LatestVersion returns the latest available pack version based on tags in the remote Github repo.
Notes ¶
Bugs ¶
Check if version exists?
This is a slow way to get requirements for a pack. It involves installing it out to a local directory. But it's also the simplest one. We can optimize by using HTTP access to pull in Oyafile and then parse the Require: section here. It means duplicating the logic including the assumption that the requires will always be stored in Oyafile, rather than a separate file along the lines of go.mod.
This doesn't take Oyafile#Replacements into account. This probably doesn't matter because it's likely meaningless for packs accessed remotely but we may want to revisit it.
Copy permissions.