Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CommitType ¶
type PrintElapsedTime ¶
type PrintElapsedTime func(functionName string) func()
type VersionControl ¶
type VersionControl struct {
// contains filtered or unexported fields
}
func NewVersionControl ¶
func NewVersionControl(log Logger, printElapsedTime PrintElapsedTime, commitType CommitType) *VersionControl
NewVersionControl is the version control constructor
func (*VersionControl) GetNewVersion ¶
func (v *VersionControl) GetNewVersion(commitMessage string, currentVersion string) (string, error)
GetNewVersion upgrade the current version based on the commitChangeType. It calls the getUpgradeType function to define where to upgrade the version (MAJOR.MINOR.PATCH). Args:
commitMessage (string): The commit message. currentVersion (string): Current release version. I.e.: 2.1.1.
Returns:
string: It will return a string with the new version. I.e.: 1 - If the current version is 2.1.1 and the update type is MAJOR it will return 3.0.0 2 - If the current version is 2.1.1 and the update type is MINOR it will return 2.2.0 1 - If the current version is 2.1.1 and the update type is PATCH it will return 2.1.2 error: It returns an error when something wrong happen.
func (*VersionControl) MustSkipVersioning ¶
func (v *VersionControl) MustSkipVersioning(commitMessage string) bool
MustSkip compare commit type with skip types (CommitTypeSkipVersioning) to avoid upgrading version. I.e.:
commitChangeType: [skip]
Output: true
Click to show internal directories.
Click to hide internal directories.