func (sv SemVer) LessThanMajor(versionB SemVer) bool { majorA := semver.Version(sv).Major majorB := semver.Version(versionB).Major if majorA < majorB { return true } return false }
func (v *IgnitionVersion) UnmarshalJSON(data []byte) error { tv := semver.Version(*v) if err := json.Unmarshal(data, &tv); err != nil { return err } *v = IgnitionVersion(tv) return nil }
func (v *IgnitionVersion) unmarshal(unmarshal func(interface{}) error) error { tv := semver.Version(*v) if err := unmarshal(&tv); err != nil { return err } *v = IgnitionVersion(tv) return nil }
func (v IgnitionVersion) Validate() report.Report { if MaxVersion.Major > v.Major { return report.ReportFromError(ErrOldVersion, report.EntryError) } if MaxVersion.LessThan(semver.Version(v)) { return report.ReportFromError(ErrNewVersion, report.EntryError) } return report.Report{} }
func (v IgnitionVersion) AssertValid() error { if MaxVersion.Major > v.Major { return ErrOldVersion } if MaxVersion.LessThan(semver.Version(v)) { return ErrNewVersion } return nil }
func (v IgnitionVersion) MarshalJSON() ([]byte, error) { return semver.Version(v).MarshalJSON() }
func (sv SemVer) Empty() bool { return semver.Version(sv) == semver.Version{} }
func (sv SemVer) String() string { s := semver.Version(sv) return s.String() }
func (sv SemVer) LessThanExact(versionB SemVer) bool { vA := semver.Version(sv) vB := semver.Version(versionB) return vA.LessThan(vB) }