architecture

package module
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2020 License: MIT Imports: 3 Imported by: 0

README

SemverUtils

Build Status

Utility for Semantic Version control. Its purpose to is read semantic release styled commit messages and current tags to calculate the next version number to use when releasing a package of a Git controlled project.

This is an initial release. Command line options are likely to change.

Download

git clone https://github.com/marshyon/semverUtils.git

Build

The following is a typical installation for a Linux OS:

cd semverUtils/cmd/version
go build -o semverutils
sudo cp semverutils /usr/local/bin

Prerequisites

Semverutils uses the command line Git executable so this will need to be installed prior to using ths application.

For Linux operating systems such as Debian / Ubuntu this is typically already installed or will need to be installed with:

sudo apt install git

Windows installations will need to have git bash installed from :

https://gitforwindows.org/

Use the Download link and follow instructions to install for Windows

Usage

Change to the directory of a Git controlled project

run

semverutils

which outputs ( to stdout ) the next version to use when publishing a new release.

Tests

The following from the root of the application directory will run unit tests:

go test -v ./...

The following from the root directory of the application directory will run BDD tests:

godog

RELEASES

testing .... feature ....

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Accessor

type Accessor interface {
	Save(n int, p Version)
	Retrieve() (map[int]Version, int)
}

Accessor interface is used to access and abstract the back-end

type Version

type Version struct {
	Tag string
}

Version struct used to store a version

type VersionService

type VersionService struct {
	// contains filtered or unexported fields
}

VersionService uses accessor interface

func NewVersionService

func NewVersionService(a Accessor) VersionService

NewVersionService creates a new service to action save and retrieve operations

func (VersionService) Get

func (vs VersionService) Get() (map[int]Version, int, error)

Get method used to access data through Version service and the Retrieve method the Retrieve method is implemented by the storage backend

func (VersionService) GetCurrentVersion

func (vs VersionService) GetCurrentVersion() (string, int, error)

func (VersionService) GetNextVersion

func (vs VersionService) GetNextVersion(currentVersion string, level int) (nextVersion string)

func (VersionService) Save

func (vs VersionService) Save(n int, p Version)

Save method used to access data through Version service and the Save method the Save method is implemented by the storage backend

Directories

Path Synopsis
cmd
version command
storage
git

Jump to

Keyboard shortcuts

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