Documentation ¶
Index ¶
- Constants
- Variables
- type Comparer
- type Constraints
- type IntItem
- type Item
- type ListItem
- type ListItemStack
- type Requirements
- type StringItem
- type Version
- func (v1 Version) Compare(v2 Version) int
- func (v1 Version) Equal(v2 Version) bool
- func (v1 Version) GreaterThan(v2 Version) bool
- func (v1 Version) GreaterThanOrEqual(v2 Version) bool
- func (v1 Version) LessThan(v2 Version) bool
- func (v1 Version) LessThanOrEqual(v2 Version) bool
- func (v1 Version) String() string
Constants ¶
View Source
const ( MINVersion = "-----1" MAXVersion = "99999999999999999999" )
Variables ¶
View Source
var ( Qualifiers = []string{"alpha", "beta", "milestone", "rc", "snapshot", "", "sp"} Aliases = map[string]string{"ga": "", "final": "", "release": "", "cr": "rc"} ReleaseVersionIndex = fmt.Sprint(indexOf("", Qualifiers)) )
Functions ¶
This section is empty.
Types ¶
type Comparer ¶
func NewComparer ¶
type Constraints ¶
type Constraints struct {
// contains filtered or unexported fields
}
Constraints is one or more constraint that a version can be checked against.
func NewConstraints ¶
func NewConstraints(v string) (Constraints, error)
func (Constraints) Check ¶
func (cs Constraints) Check(v Version) bool
func (Constraints) String ¶
func (cs Constraints) String() string
String returns the string format of the constraints
type ListItemStack ¶
type ListItemStack []ListItem
func (*ListItemStack) IsEmpty ¶
func (s *ListItemStack) IsEmpty() bool
IsEmpty checks if stack is empty
func (*ListItemStack) Pop ¶
func (s *ListItemStack) Pop() ListItem
Pop removes and returns top element of stack. Return false if stack is empty.
func (*ListItemStack) Push ¶
func (s *ListItemStack) Push(item ListItem)
Push pushes a new value onto the stack
type Requirements ¶
type Requirements struct {
// contains filtered or unexported fields
}
func NewRequirements ¶
func NewRequirements(v string) (Requirements, error)
NewRequirements is return Requirement [1.0.0], [1.0.1] => []requirement{"[1.0.0]","[1.0.1]"} [1.0.0] => []requirement{"[1.0.0]"}
func (Requirements) Check ¶
func (rs Requirements) Check(v Version) bool
type StringItem ¶
type StringItem string
func (StringItem) Compare ¶
func (item1 StringItem) Compare(item2 Item) int
type Version ¶
func NewVersion ¶
func (Version) GreaterThan ¶
func (Version) GreaterThanOrEqual ¶
func (Version) LessThanOrEqual ¶
Click to show internal directories.
Click to hide internal directories.