ver

package
v1.1.0-rc15 Latest Latest
Warning

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

Go to latest
Published: May 17, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidSemVer     = errors.New("invalid semantic version")
	ErrInvalidMetadata   = errors.New("invalid Metadata string")
	ErrInvalidPrerelease = errors.New("invalid Prerelease string")
)

Functions

This section is empty.

Types

type Constraints

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

func NewConstraint

func NewConstraint(c string) (*Constraints, error)

func (Constraints) Check

func (cs Constraints) Check(v *Version) bool

func (Constraints) String

func (cs Constraints) String() string

func (Constraints) Validate

func (cs Constraints) Validate(v *Version) (bool, []error)

type Version

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

func MustParseVersion

func MustParseVersion(v string) *Version

func ParseVersion

func ParseVersion(v string) (*Version, error)

func (*Version) Compare

func (v *Version) Compare(o *Version) int

func (*Version) DataType

func (v *Version) DataType(driver string) string

func (*Version) Equal

func (v *Version) Equal(o *Version) bool

func (*Version) GreaterThan

func (v *Version) GreaterThan(o *Version) bool

func (Version) IncrMajor

func (v Version) IncrMajor() *Version

func (Version) IncrMinor

func (v Version) IncrMinor() *Version

func (Version) IncrPatch

func (v Version) IncrPatch() *Version

func (*Version) LessThan

func (v *Version) LessThan(o *Version) bool

func (Version) Major

func (v Version) Major() uint64

func (Version) MarshalJSON

func (v Version) MarshalJSON() ([]byte, error)

func (Version) MarshalText

func (v Version) MarshalText() ([]byte, error)

func (Version) Metadata

func (v Version) Metadata() string

func (Version) Minor

func (v Version) Minor() uint64

func (Version) Patch

func (v Version) Patch() uint64

func (Version) Prerelease

func (v Version) Prerelease() string

func (*Version) Scan

func (v *Version) Scan(value interface{}) error

func (Version) String

func (v Version) String() string

func (*Version) UnmarshalJSON

func (v *Version) UnmarshalJSON(b []byte) error

func (*Version) UnmarshalText

func (v *Version) UnmarshalText(b []byte) error

func (Version) Value

func (v Version) Value() (driver.Value, error)

func (Version) WithBuildMetadata

func (v Version) WithBuildMetadata(buildMetadata string) (*Version, error)

func (Version) WithPrerelease

func (v Version) WithPrerelease(prerelease string) (*Version, error)

type Versions

type Versions []Version

func (Versions) Len

func (c Versions) Len() int

func (Versions) Less

func (c Versions) Less(i, j int) bool

func (Versions) Swap

func (c Versions) Swap(i, j int)

Jump to

Keyboard shortcuts

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