vergen

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 21, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CalendarVersion

type CalendarVersion struct {
	// Year of the version.
	Year int

	// Month of the version.
	Month time.Month

	// Day of the version.
	Day int

	// RevisionID is an offset from 0 indicating the number of releases on the date.
	RevisionID int
}

func (*CalendarVersion) String

func (v *CalendarVersion) String() string

type Generator

type Generator struct {
	GitRepo          *git.Repository
	ReleaseTagPrefix string
}

func NewGenerator

func NewGenerator() (*Generator, error)

func (*Generator) LatestReleaseVersion

func (g *Generator) LatestReleaseVersion(fallback string) (string, error)

func (*Generator) NextReleaseVersion

func (g *Generator) NextReleaseVersion() (Version, error)

func (*Generator) PreviewVersion

func (g *Generator) PreviewVersion(branch, authority string, generateRevisionID bool) (Version, error)

PreviewVersion generates a "preview" style version identifier.

branch - Manually override branch name detection. This is useful in CI where vergen can be used with a detached head

and the branch can be passed along via environment variable.

authority - authorized person or system generating the preview version.

generateRevisionID - generate a revision ID to distinguish between two invocations. Useful when used on dirty Git

trees.

type PreviewVersion

type PreviewVersion struct {
	CommitID   string
	Branch     string
	Authority  string
	RevisionID string
}

func (*PreviewVersion) String

func (v *PreviewVersion) String() string

type Version

type Version interface {
	String() string
}

Jump to

Keyboard shortcuts

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