version

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Copyright 2020 The Kubernetes Authors.

SPDX-License-Identifier: Apache-2.0

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Version

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

Version type definition for handling simple version comparision

func NewVersion

func NewVersion(major, minor uint) Version

NewVersion creates a new version object for given major and minor version values

func Parse

func Parse(version string) (Version, error)

Parse creates a new version with major/minor from the given string, which must have the format <major>.<minor>. Error texts do not include the version string itself.

func (Version) Compare

func (v Version) Compare(major, minor uint) int

Compare compares v with given otherVersion Returns - 0 if two versions are same - >0 if v is greater otherVersion - <0 if v is less than otherVersion

func (Version) CompareVersion added in v1.1.0

func (v Version) CompareVersion(other Version) int

CompareVersion is the same as Compare with a Version as argument.

func (Version) Major

func (v Version) Major() uint

Major returns major version of v

func (Version) Minor

func (v Version) Minor() uint

Minor returns minor version of v

func (Version) String

func (v Version) String() string

Jump to

Keyboard shortcuts

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