adguardhome-sync/pkg/versions/versions.go
Marc Brugger ff104f543d
Fix API change and block inconsistent version v0.107.14 (#100)
* fix api content change from string to json #99

* block incompatible version #99

* fix tests #99

* add mote tests #99
2022-10-04 19:55:00 +02:00

25 lines
769 B
Go

package versions
import "golang.org/x/mod/semver"
const (
// MinAgh minimal adguardhome version
MinAgh = "v0.107.0"
// LastStringCustomRules last adguardhome version with string payload custom rules
// https://github.com/bakito/adguardhome-sync/issues/99
LastStringCustomRules = "v0.107.13"
// IncompatibleAPI adguardhome version with incompatible API
// https://github.com/bakito/adguardhome-sync/issues/99
IncompatibleAPI = "v0.107.14"
// FixedIncompatibleAPI adguardhome version with fixed API
// https://github.com/bakito/adguardhome-sync/issues/99
FixedIncompatibleAPI = "v0.107.15"
)
func IsNewerThan(v1 string, v2 string) bool {
return semver.Compare(v1, v2) == 1
}
func IsSame(v1 string, v2 string) bool {
return semver.Compare(v1, v2) == 0
}