refactor: WARP

This commit is contained in:
Shtorm
2025-06-08 19:51:17 +03:00
parent dfc6fce8bb
commit 3d8c74efa4
12 changed files with 346 additions and 253 deletions

View File

@@ -15,7 +15,7 @@ type CloudflareProfile struct {
PremiumData int `json:"premium_data"`
Quota int `json:"quota"`
Usage int `json:"usage"`
WarpPlus bool `json:"warp_plus"`
WARPPlus bool `json:"warp_plus"`
ReferralCount int `json:"referral_count"`
ReferralRenewalCountdown int `json:"referral_renewal_countdown"`
Role string `json:"role"`
@@ -23,9 +23,14 @@ type CloudflareProfile struct {
TTL time.Time `json:"ttl"`
} `json:"account"`
Config struct {
ClientID string `json:"client_id"`
PrivateKey string `json:"private_key"`
Peers []struct {
ClientID string `json:"client_id"`
Interface struct {
Addresses struct {
V4 string `json:"v4"`
V6 string `json:"v6"`
} `json:"addresses"`
} `json:"interface"`
Peers []struct {
PublicKey string `json:"public_key"`
Endpoint struct {
V4 string `json:"v4"`
@@ -34,12 +39,6 @@ type CloudflareProfile struct {
Ports []int `json:"ports"`
} `json:"endpoint"`
} `json:"peers"`
Interface struct {
Addresses struct {
V4 string `json:"v4"`
V6 string `json:"v6"`
} `json:"addresses"`
} `json:"interface"`
Services struct {
HTTPProxy string `json:"http_proxy"`
} `json:"services"`
@@ -49,7 +48,7 @@ type CloudflareProfile struct {
} `json:"metrics"`
} `json:"config"`
Token string `json:"token"`
WarpEnabled bool `json:"warp_enabled"`
WARPEnabled bool `json:"warp_enabled"`
WaitlistEnabled bool `json:"waitlist_enabled"`
Created time.Time `json:"created"`
Updated time.Time `json:"updated"`