repo

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: May 20, 2019 License: MIT Imports: 18 Imported by: 0

Documentation

Index

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)

func (ErrClone) Error

func (err ErrClone) Error() string

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 (l *GithubRepo) IsInstalled(version semver.Version, installDir string) (bool, error)

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.

func (*GithubRepo) Reqs

func (l *GithubRepo) Reqs(version semver.Version) ([]pack.Pack, error)

func (*GithubRepo) Version

func (l *GithubRepo) Version(version semver.Version) (pack.Pack, error)

Version returns the specified version of the pack. NOTE: It doesn't check if it's available remotely. This may change. It is used when loading Oyafiles so we probably shouldn't do it or use a different function there.

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.

Jump to

Keyboard shortcuts

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