semver

package
v0.11.5 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Validate

func Validate(version string) bool

Validate

Types

type SemVer

type SemVer struct {
	Major      string
	Minor      string
	Patch      string
	PreRelease string
	Build      string
}

SemVer is a sematinc version representation

func NewSemVer

func NewSemVer(version string) (*SemVer, error)

NewSemVer return an struct containing the version input parsed. It returns an error when version does not match to semver

func (*SemVer) String

func (v *SemVer) String() string

String return *SemVer in string format

func (*SemVer) VersionTree

func (v *SemVer) VersionTree(listTmpl []string) ([]string, error)

VersionTree return semver versions from v and based on list templates. example: from 1.2.3 --> [1, 1.2, 1.2.3]. It returns an error when a template could not be parsed

type SemVerGenerator

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

func NewSemVerGenerator

func NewSemVerGenerator() *SemVerGenerator

func (*SemVerGenerator) GenerateSemvVer

func (g *SemVerGenerator) GenerateSemvVer(version string) error

func (*SemVerGenerator) GenerateSemverList

func (g *SemVerGenerator) GenerateSemverList(versions []string, tmpls []string) ([]string, error)

func (*SemVerGenerator) GenerateVersionTree

func (g *SemVerGenerator) GenerateVersionTree(tmpl []string) ([]string, error)

Jump to

Keyboard shortcuts

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