repos

package
v0.0.0-...-7928a3c Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2016 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package repos provides methods for repositories.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Clean

func Clean(dir string) error

Clean cleans a repository codebase.

func Download

func Download(r *Repo, dir, vendorRev string) (string, error)

Download writes the source contents of a Repo to disk. The revision version of the repository is returned and the directory is created.

Types

type Repo

type Repo struct {
	VCS *VCS

	// URL is the repository URL, including scheme
	URL string

	// ImportPath is the import path corresponding to the root of the repository
	ImportPath string
}

Repo RepoRoot

func ImportDynamic

func ImportDynamic(importpath string, verbose bool) (*Repo, error)

ImportDynamic returns a new Repo.

func ImportPath

func ImportPath(importpath string, verbose bool) (*Repo, error)

ImportPath returns a new Repo.

func New

func New(v *VCS, url, importpath string) *Repo

New returns a new Repo.

func Ping

func Ping(pkg string) (*Repo, error)

Ping checks the host server to determine the package Repo.

type VCS

type VCS struct {
	*vcs.Cmd

	IdentifyCmd string
	DescribeCmd string
	DiffCmd     string

	// run in sandbox repos
	ExistsCmd string
}

VCS represents a version control system for a repository.

func Dir

func Dir(dir, srcRoot string) (*VCS, string, error)

Dir inspects dir and its parents to determine the version control system and code repository to use. On return, root is the import path corresponding to the root of the repository (thus root is a prefix of importPath).

func NewVCS

func NewVCS(v *vcs.Cmd) (*VCS, error)

NewVCS creates a new VCS object.

func (*VCS) Describe

func (v *VCS) Describe(dir, rev string) string

Describe describes a package via directory path and revision string.

func (*VCS) Dirty

func (v *VCS) Dirty(dir, rev string) bool

Dirty determines if a local repo on disk is not clean.

func (*VCS) Exists

func (v *VCS) Exists(dir, rev string) bool

Exists tests if a revision exists on local disk in a repo.

func (*VCS) Identify

func (v *VCS) Identify(dir string) (string, error)

Identify takes a directory path and returns a revision string.

func (*VCS) RevSync

func (v *VCS) RevSync(dir, rev string) error

RevSync checks out the revision given by rev in dir. The dir must exist and rev must be a valid revision.

Jump to

Keyboard shortcuts

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