platform: modularize api/gui, add docs-tests-web foundation, and refresh root config

This commit is contained in:
beckline
2026-03-26 22:40:54 +03:00
parent 0e2d7f61ea
commit 6a56d734c2
562 changed files with 70151 additions and 16423 deletions

View File

@@ -0,0 +1,35 @@
package app
import egressutilpkg "selective-vpn-api/app/egressutil"
func parseEgressScope(raw string) (egressScopeTarget, error) {
target, err := egressutilpkg.ParseScope(raw, sanitizeID)
if err != nil {
return egressScopeTarget{}, err
}
return egressScopeTarget{
Scope: target.Scope,
Source: target.Source,
SourceID: target.SourceID,
}, nil
}
func egressIdentityChanged(prev, next EgressIdentity) bool {
return egressutilpkg.IdentityChanged(
egressIdentitySnapshot(prev),
egressIdentitySnapshot(next),
)
}
func egressIdentitySnapshot(item EgressIdentity) egressutilpkg.IdentitySnapshot {
return egressutilpkg.IdentitySnapshot{
IP: item.IP,
CountryCode: item.CountryCode,
CountryName: item.CountryName,
UpdatedAt: item.UpdatedAt,
Stale: item.Stale,
RefreshInProgress: item.RefreshInProgress,
LastError: item.LastError,
NextRetryAt: item.NextRetryAt,
}
}