module

package
v0.0.0-...-9c94f8f Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2017 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Module

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

func Load

func Load(gitDir string) *Module

Load creates a new Module object that reads its data from the given git repository directory.

This function returns nil if the given directory cannot be opened as a git repository for any reason.

func (Module) AllVersions

func (m Module) AllVersions() ([]*version.Version, error)

AllVersions returns all of the available versions for the receiving module, in reverse order such that the latest version is at index 0.

The result may be an empty (or nil) slice if the underlying repository has no version-shaped tags.

func (Module) GetVersionTreeId

func (m Module) GetVersionTreeId(v *version.Version) (string, error)

func (Module) HasVersion

func (m Module) HasVersion(v *version.Version) (bool, error)

HasVersion returns true if the receiving module has a tag for the given version number.

func (Module) LatestVersion

func (m Module) LatestVersion() (*version.Version, error)

LatestVersion returns the latest version available for the receiving module, or nil if it has no versions.

func (Module) WriteVersionTar

func (m Module) WriteVersionTar(v *version.Version, w io.Writer) error

WriteVersionTar recursively writes the contents of the git tree associated with the given version to the given writer. If no such version exists, or if there are any other problems when reading the tree, the resulting tar archive may be incomplete.

Jump to

Keyboard shortcuts

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