scm

package
v0.0.0-...-d2a39d3 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Git

type Git struct {
	// contains filtered or unexported fields
}

func Github

func Github(organization, repository string) (*Git, error)

Github clones remote specified by the provided organization and repository names as "origin" without checking out a working tree (for performance reasons).

func Repository

func Repository(url string) (*Git, error)

Repository clones remote specified by the provided URL as "origin" without checking out a working tree (for performance reasons).

func (*Git) Checkout

func (g *Git) Checkout(reference *plumbing.Reference) (*git.Worktree, error)

Checkout retrieves the working tree for the specified reference from the specified repository.

func (*Git) Filepaths

func (g *Git) Filepaths() ([]string, error)

Filepaths walks the worktree's filesystem hierarchy and returns a slice of FileInfo values for all the elements encountered.

func (*Git) Latest

func (g *Git) Latest() (*plumbing.Reference, error)

Latest returns the reference to the latest tag matching the semver criteria without a prerelease suffix (highest, major, minor, bug values ignoring the build number suffix if present).

func (*Git) Releases

func (g *Git) Releases() ([]*plumbing.Reference, error)

Releases returns the list of tags that match the semantic versioning criteria and do not include a prerelease suffix.

func (*Git) Source

func (g *Git) Source(path string) ([]byte, error)

Source retrieves the contents of the file at the provided path from the repository's current worktree.

func (*Git) Walk

func (g *Git) Walk(fn filepath.WalkFunc) error

Walk traverses the in-memory working tree filesystem hierarchy, while applying the provided WalkFunc to each inspected element.

type GitError

type GitError struct {
	// contains filtered or unexported fields
}

func (GitError) Error

func (e GitError) Error() string

func (GitError) Unwrap

func (e GitError) Unwrap() error

type GitErrorMsg

type GitErrorMsg string
const (
	CheckoutFailed     GitErrorMsg = "failed to checkout the requested worktree"
	CloneFailed        GitErrorMsg = "failed to clone the repository"
	GetTagsFailed      GitErrorMsg = "failed to retrieve repository tags"
	NoReleaseTag       GitErrorMsg = "repository has no release tags matching semver"
	SourceReadFailed   GitErrorMsg = "failed to read source file"
	WorktreeWalkFailed GitErrorMsg = "error walking the worktree"
)

func (GitErrorMsg) Error

func (e GitErrorMsg) Error() string

func (GitErrorMsg) Wrap

func (e GitErrorMsg) Wrap(cause error) GitError

Jump to

Keyboard shortcuts

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