MCPcopy Create free account
hub / github.com/couchbase/sync_gateway / IsEqualToOrAfter

Method IsEqualToOrAfter

rest/user_agent_version.go:91–114  ·  view source on GitHub ↗
(otherMajorVersion, otherMinorVersion int)

Source from the content-addressed store, hash-verified

89}
90
91func (uav UserAgentVersion) IsEqualToOrAfter(otherMajorVersion, otherMinorVersion int) bool {
92
93 // if our major version is less than their major version, then there's no
94 // way we could be after their overall version, so return false
95 if uav.MajorVersion() < otherMajorVersion {
96 return false
97 }
98
99 // if our major version is greater than their major version, we're definitely
100 // after so return true
101 if uav.MajorVersion() > otherMajorVersion {
102 return true
103 }
104
105 // the major versions are equal, so it's down to minor versions.
106 // if we're strictly after their minor version, return true
107 if uav.MinorVersion() >= otherMinorVersion {
108 return true
109 }
110
111 // looks like we're less than their minor version, so return false
112 return false
113
114}
115
116func (uav UserAgentVersion) IsBefore(otherMajorVersion, otherMinorVersion int) bool {
117 return !uav.IsEqualToOrAfter(otherMajorVersion, otherMinorVersion)

Callers 2

IsBeforeMethod · 0.95

Calls 2

MajorVersionMethod · 0.95
MinorVersionMethod · 0.95

Tested by 1