platform: modularize api/gui, add docs-tests-web foundation, and refresh root config
This commit is contained in:
25
selective-vpn-api/app/egressutil/identity.go
Normal file
25
selective-vpn-api/app/egressutil/identity.go
Normal file
@@ -0,0 +1,25 @@
|
||||
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)
|
||||
}
|
||||
Reference in New Issue
Block a user