version

package
v0.0.0-...-3dadef2 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2016 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Overview

Package version provides versioning for the agent. A client is expected to be able to start and communicate with an agent that supports a compatible version.

Index

Constants

This section is empty.

Variables

View Source
var Supported = Range{Min: 0, Max: 0}

Supported defines the version range supported by the current binary.

Functions

This section is empty.

Types

type Range

type Range struct {
	Min, Max T
}

Range describes a range of versions.

func RangeFromString

func RangeFromString(ctx *context.T, min, max string) (Range, error)

RangeFromString parses a Range from the given string min, max values.

func (Range) Contains

func (r Range) Contains(v T) bool

Contains returns whether the given version is in the given range.

func (Range) String

func (r Range) String() string

String returns a string representation of the range.

type T

type T uint32

func Common

func Common(ctx *context.T, l, r Range) (T, error)

Common returns the highest common version between the provided ranges. Returns an error if no such version exists.

func (*T) Set

func (v *T) Set(s string) error

Set parses the version from the given string. An error is returned if the string appears in the wrong syntax or represents an invalid version number.

func (T) String

func (v T) String() string

String returns a string representation of version.

Jump to

Keyboard shortcuts

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