Documentation ¶
Index ¶
Constants ¶
const Auto = "auto"
Auto strategy name for AutoStrategy.
const GitCommit = "git-commit"
GitCommit strategy name for GitCommitStrategy.
const Major = "major"
Major semver version level for major
const Minor = "minor"
Minor semver version level for minor
const Patch = "patch"
Patch semver version level for patch
Variables ¶
var DefaultFeatureRegex = regexp.MustCompile(`(\[feature]|feature/)`)
var DefaultFixRegex = regexp.MustCompile(`(\[fix]|fix/)`)
var DefaultReleaseRegex = regexp.MustCompile(`(\[release]|release/)`)
Functions ¶
This section is empty.
Types ¶
type AutoStrategy ¶
AutoStrategy implementation of the Strategy interface. It makes use of several strategies and defaults to PatchStrategy as a last resort.
func NewAutoStrategy ¶
func NewAutoStrategy(gitCommitStrategy Strategy) AutoStrategy
NewAutoStrategy creates a new AutoStrategy. Returns the new AutoStrategy.
func (AutoStrategy) Increment ¶
func (autoStrategy AutoStrategy) Increment(targetVersion string) (nextVersion string, err error)
Increment increments a given version using the AutoStrategy. It will attempt to increment the target version with several strategies:
- the GitCommitStrategy
- the PatchStrategy
Returns the incremented version or an error if anything went wrong.
type GitCommitStrategy ¶
type GitCommitStrategy struct {
// contains filtered or unexported fields
}
GitCommitStrategy implementation of the Strategy interface. It makes use of several matching strategies based on git commit messages.
func NewGitCommitStrategy ¶
func NewGitCommitStrategy(gitService git.Service) GitCommitStrategy
NewGitCommitStrategy creates a new GitCommitStrategy. Returns the new GitCommitStrategy.
func (GitCommitStrategy) GetMatchedStrategy ¶
func (strategy GitCommitStrategy) GetMatchedStrategy(message string) (matched Strategy, err error)
GetMatchedStrategy gets the strategy that matches specific tokens within the git commit message. It returns the matched strategy.
type MajorStrategy ¶
type MajorStrategy struct{}
MajorStrategy implementation of the Strategy interface. It makes use of the major level of semver versions.
func NewMajorStrategy ¶
func NewMajorStrategy() MajorStrategy
NewMajorStrategy creates a new MajorStrategy. Returns the new MajorStrategy.
type MinorStrategy ¶
type MinorStrategy struct{}
MinorStrategy implementation of the Strategy interface. It makes use of the minor level of semver versions.
func NewMinorStrategy ¶
func NewMinorStrategy() MinorStrategy
NewMinorStrategy creates a new MinorStrategy. Returns the new MinorStrategy.
type PatchStrategy ¶
type PatchStrategy struct{}
PatchStrategy implementation of the Strategy interface. It makes use of the patch level of semver versions.
func NewPatchStrategy ¶
func NewPatchStrategy() PatchStrategy
NewPatchStrategy creates a new PatchStrategy. Returns the new PatchStrategy.