version

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2025 License: Apache-2.0 Imports: 5 Imported by: 3

Documentation

Overview

Package version contains a PostgreSQL image version parser with the corresponding data type and operations on it

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsUpgradePossible

func IsUpgradePossible(fromVersion, toVersion Data) bool

IsUpgradePossible detect if it's possible to upgrade from fromVersion to toVersion

Types

type Data

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

Data is a structure used to manage a PostgreSQL version, consisting of two parts: major and minor. For instance, version 10.0 corresponds to a major of 10 and a minor of 0. See: https://www.postgresql.org/support/versioning/

func FromTag

func FromTag(version string) (Data, error)

FromTag parse a PostgreSQL version string returning a major version ID. Example:

FromTag("11.2") == (11,2)
FromTag("12.1") == (12,1)
FromTag("13.3.2.1-1") == (13,3)
FromTag("13.4") == (13,4)
FromTag("14") == (14,0)
FromTag("15.5-10") == (15,5)
FromTag("16.0") == (16,0)
FromTag("17beta1") == (17,0)
FromTag("17rc1") == (17,0)

func New

func New(major, minor uint64) Data

New constructs a version from its components

func (Data) Less

func (d Data) Less(other Data) bool

Less is the implementation of the "less than" operator

func (Data) Major

func (d Data) Major() uint64

Major gets the major version (i.e. 10)

func (Data) Minor

func (d Data) Minor() uint64

Minor gets the minor version (i.e. 0)

Jump to

Keyboard shortcuts

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