Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNoRepository = fs.ErrNotExist
Error when trying to parse a directory that is not a Git repository
Functions ¶
This section is empty.
Types ¶
type Git ¶
type Git struct {
// contains filtered or unexported fields
}
parser.VersionParser implementation using Git as data backend
func New ¶
New creates a new parser.Parser instance using the provided directory as project root. the git executable is invoked using the provided path.
func NewSystem ¶
NewSystem creates a new parser.Parser instance using the provided directory as project root. the git executable is invoked as-is, relying on its presence in one of the PATH directories.
func TryParse ¶
TryParse attempts to parse the given directory as Git repository using the provided command. If the given path does not seem to be a Git repository, ErrNoRepository is returned. All other errors are a result of file access problems or data corruption issues.
func TrySystemParse ¶
TrySystemParse calls TryParse using the Git command found in the PATH
func (*Git) ParseVersionInfo ¶
func (g *Git) ParseVersionInfo() (*buildinfo.VersionInfo, error)
ParseVersionInfo implements the parser.VersionParser interface