version

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2021 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) 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