Documentation
¶
Index ¶
- Variables
- type ChangeType
- type Version
- func (v *Version) Bump(change ChangeType)
- func (v *Version) BumpMajor()
- func (v *Version) BumpMinor()
- func (v *Version) BumpPatch()
- func (v *Version) BumpPreRelease(change ChangeType, pre string)
- func (v *Version) IsGreater(other *Version) bool
- func (v *Version) IsPreRelease() bool
- func (v *Version) LatestChangeType() ChangeType
- func (v Version) Next(t ChangeType, pre ...string) *Version
- func (v *Version) Revert()
- func (v *Version) String() string
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidVersion = errors.New("invalid version")
Functions ¶
This section is empty.
Types ¶
type ChangeType ¶
type ChangeType int
ChangeType is the type of change that commit has made in repository.
const ( // ChangeTypeNone - changes made in commit that doesn't match any // of the provided in configuration file version type. ChangeTypeNone ChangeType = iota // ChangeTypePatch - bump patch version. ChangeTypePatch // ChangeTypeMinor - bump minor version. ChangeTypeMinor // ChangeTypeMajor - bump major version. ChangeTypeMajor )
func (ChangeType) String ¶
func (ct ChangeType) String() (s string)
type Version ¶
Version wraps semver library with features related with parsed from commit message change type.
func (*Version) Bump ¶
func (v *Version) Bump(change ChangeType)
Bump changes version based on given change type.
func (*Version) BumpPreRelease ¶
func (v *Version) BumpPreRelease(change ChangeType, pre string)
BumpPreRelease bumps pre-release build version.
func (*Version) IsPreRelease ¶
IsPreRelease returns true if version has pre-release part.
func (*Version) LatestChangeType ¶
func (v *Version) LatestChangeType() ChangeType
LatestChangeType returns latest change type based on current version.
Click to show internal directories.
Click to hide internal directories.