26 lines
876 B
Go
26 lines
876 B
Go
package egressutil
|
|
|
|
import "strings"
|
|
|
|
type IdentitySnapshot struct {
|
|
IP string
|
|
CountryCode string
|
|
CountryName string
|
|
UpdatedAt string
|
|
Stale bool
|
|
RefreshInProgress bool
|
|
LastError string
|
|
NextRetryAt string
|
|
}
|
|
|
|
func IdentityChanged(prev, next IdentitySnapshot) bool {
|
|
return strings.TrimSpace(prev.IP) != strings.TrimSpace(next.IP) ||
|
|
strings.TrimSpace(prev.CountryCode) != strings.TrimSpace(next.CountryCode) ||
|
|
strings.TrimSpace(prev.CountryName) != strings.TrimSpace(next.CountryName) ||
|
|
strings.TrimSpace(prev.UpdatedAt) != strings.TrimSpace(next.UpdatedAt) ||
|
|
prev.Stale != next.Stale ||
|
|
prev.RefreshInProgress != next.RefreshInProgress ||
|
|
strings.TrimSpace(prev.LastError) != strings.TrimSpace(next.LastError) ||
|
|
strings.TrimSpace(prev.NextRetryAt) != strings.TrimSpace(next.NextRetryAt)
|
|
}
|