ver

package
v0.0.0-...-00cc882 Latest Latest
Warning

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

Go to latest
Published: May 17, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// FullYear notation - 2006, 2016, 2106
	FullYear = "YYYY"
	// ShortYear notation - 6, 16, 106
	ShortYear = "YY"
	// PaddedYear notation - 06, 16, 106
	PaddedYear = "0Y"
	// ShortMonth notation - 1, 2 ... 11, 12
	ShortMonth = "MM"
	// PaddedMonth notation - 01, 02 ... 11, 12
	PaddedMonth = "0M"
	// ShortWeek notation - 1, 2, 33, 52
	ShortWeek = "WW"
	// PaddedWeek notation - 01, 02, 33, 52
	PaddedWeek = "0W"
	// ShortDay notation - 1, 2 ... 30, 31
	ShortDay = "DD"
	// PaddedDay notation - 01, 02 ... 30, 31
	PaddedDay = "0D"

	Minor = "MINOR"
	Micro = "MICRO"
	Auto  = "AUTO"
)

Variables

Functions

func GetLatestAutoInc

func GetLatestAutoInc(cv *CalVer) (int, error)

func Retag

func Retag(args TagArgs) (string, error)

func SetRepoFormat

func SetRepoFormat(f *Format) error

func TagExists

func TagExists(tag string) bool

func TagNext

func TagNext(args TagArgs) (string, error)

func Untag

func Untag(args TagArgs) error

func VerifyHash

func VerifyHash(hash string) (string, error)

Types

type CalVer

type CalVer struct {
	Format        *Format
	Minor         uint
	Micro         uint
	AutoIncrement bool
	Increment     uint
	Modifier      string
	// contains filtered or unexported fields
}

func NewCalVer

func NewCalVer(a CalVerArgs) (*CalVer, error)

func NextCalVer

func NextCalVer(a CalVerArgs) (*CalVer, error)

func (*CalVer) Regex

func (c *CalVer) Regex() *regexp.Regexp

func (*CalVer) Version

func (c *CalVer) Version(t time.Time) (string, error)

type CalVerArgs

type CalVerArgs struct {
	Format        *Format
	RawFormat     string
	Minor         *uint
	Micro         *uint
	Modifier      string
	DryRun        bool
	AutoIncrement bool
	Hash          string
}

func (*CalVerArgs) String

func (c *CalVerArgs) String() string

type CalVerTagGroup

type CalVerTagGroup struct {
	Hash      string
	Tags      []string
	When      time.Time
	Commit    *object.Commit
	Refs      []*plumbing.Reference
	Latest    bool
	ChangeLog []*object.Commit
}

func LatestTag

func LatestTag(reg *regexp.Regexp, changelog bool) (*CalVerTagGroup, error)

func ListTags

func ListTags(reg *regexp.Regexp, limit int, changelog bool) ([]*CalVerTagGroup, error)

func (*CalVerTagGroup) Print

func (cvt *CalVerTagGroup) Print(w io.Writer, noColour bool)

func (*CalVerTagGroup) Time

func (cvt *CalVerTagGroup) Time() time.Time

type Format

type Format struct {
	Major segment
	Minor segment
	Micro segment
}

func GetRepoFormat

func GetRepoFormat() (*Format, bool, error)

func NewFormat

func NewFormat(raw string) (*Format, error)

func (*Format) NeedsMicro

func (f *Format) NeedsMicro() bool

func (*Format) NeedsMinor

func (f *Format) NeedsMinor() bool

func (*Format) String

func (f *Format) String() string

func (*Format) Version

func (f *Format) Version(t time.Time) string

type TagArgs

type TagArgs struct {
	CV   *CalVer
	Hash string
	Push bool
	Tag  string
}

Jump to

Keyboard shortcuts

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