version

package
v0.0.0-...-9474aff Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2022 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Overview

Package version provides common utils to handle browser version info.

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 represents a browser version in the format of "(major).(minor).(build).(patch)".

func New

func New(major, minor, build, patch int64) *Version

New creates a new instance of Version with version components.

func Parse

func Parse(version string) Version

Parse creates a new instance of Version from a given string expression of version.

func (*Version) Build

func (v *Version) Build() int64

Build returns a build version component.

func (*Version) Decrement

func (v *Version) Decrement(o *Version) Version

Decrement decreases version by given components, returns a copy of it.

func (*Version) GetString

func (v *Version) GetString() string

GetString returns a version string. e,g, "99.0.1.0"

func (*Version) Increment

func (v *Version) Increment(o *Version) Version

Increment increases version by given components, returns a copy of it.

func (*Version) IsEqualTo

func (v *Version) IsEqualTo(rhs Version) bool

IsEqualTo returns true when the two versions are the same.

func (*Version) IsNewerThan

func (v *Version) IsNewerThan(rhs Version) bool

IsNewerThan compares two version and returns true when lhs is newer than rhs.

func (*Version) IsOlderThan

func (v *Version) IsOlderThan(rhs Version) bool

IsOlderThan compares two version and returns true when lhs is older than rhs.

func (*Version) IsSkewValid

func (v *Version) IsSkewValid(ash Version) bool

IsSkewValid returns whether it is a valid version skew that is compatible with the given ash/OS version.

func (*Version) IsValid

func (v *Version) IsValid() bool

IsValid checks if the version is set with valid numbers.

func (*Version) Major

func (v *Version) Major() int64

Major returns a major version component.

func (*Version) Minor

func (v *Version) Minor() int64

Minor returns a minor version component.

func (*Version) Patch

func (v *Version) Patch() int64

Patch returns a patch version component.

Jump to

Keyboard shortcuts

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