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,46 @@
package app
import (
"net/netip"
transporttoken "selective-vpn-api/app/transporttoken"
"sync"
"time"
)
const (
transportStateVersion = 1
transportDefaultIfaceID = "shared"
transportConfirmTTL = 10 * time.Minute
transportMarkStart uint64 = 0x100
transportMarkEnd uint64 = 0x1ff
transportMarkReserveEnd uint64 = 0x10f
transportPrefStart = 13000
transportPrefStep = 50
transportPrefEnd = 19999
transportPrefReserveEnd = 13249
)
type transportClientsState struct {
Version int `json:"version"`
UpdatedAt string `json:"updated_at,omitempty"`
Items []TransportClient `json:"items,omitempty"`
}
type cidrIntent struct {
ClientID string
Prefix netip.Prefix
Key string
}
type transportValidationResult struct {
Normalized []TransportPolicyIntent
Conflicts []TransportConflictRecord
Summary TransportPolicyValidateSummary
Diff TransportPolicyDiff
Valid bool
}
var (
transportMu sync.Mutex
transportConfirmStore = transporttoken.NewStore(transportConfirmTTL)
)