This commit is contained in:
kayos@tcp.direct 2022-05-22 18:34:15 -07:00
parent 1f4c5be640
commit 785c63530a
Signed by: kayos
GPG Key ID: 4B841471B4BEE979
5 changed files with 13 additions and 11 deletions

@ -11,7 +11,6 @@ import (
"strconv" "strconv"
) )
func (api *APIClient) debugPrintf(format string, obj ...interface{}) { func (api *APIClient) debugPrintf(format string, obj ...interface{}) {
if api.Debug { if api.Debug {
fmt.Println(fmt.Sprintf(format, obj...)) fmt.Println(fmt.Sprintf(format, obj...))

18
api.go

@ -81,13 +81,17 @@ type pagination struct {
// UserPackage represents a proxy package purchased from proxybonanza.com. // UserPackage represents a proxy package purchased from proxybonanza.com.
type UserPackage struct { type UserPackage struct {
ID int `json:"id"` ID int `json:"id"`
CustomName interface{} `json:"custom_name"` CustomName interface{} `json:"custom_name"`
Login string `json:"login"` Login string `json:"login"`
Password string `json:"password"` Password string `json:"password"`
Expires time.Time `json:"expires"` Expires time.Time `json:"expires"`
Bandwidth int64 `json:"bandwidth"` Bandwidth int64 `json:"bandwidth"`
LastIPChange time.Time `json:"last_ip_change"`
// FIXME:
// See https://github.com/yunginnanet/ProxyGonanza/issues/1
// LastIPChange time.Time `json:"last_ip_change"`
LowBanwidthNotificationPercent int `json:"low_banwidth_notification_percent"` LowBanwidthNotificationPercent int `json:"low_banwidth_notification_percent"`
Package PackageDetails `json:"package"` Package PackageDetails `json:"package"`
BandwidthGb float64 `json:"bandwidth_gb"` BandwidthGb float64 `json:"bandwidth_gb"`

@ -37,6 +37,6 @@ func main() {
fmt.Printf("\nfound %d auth IPs\n", len(authips)) fmt.Printf("\nfound %d auth IPs\n", len(authips))
for _, i := range authips { for _, i := range authips {
pretty, _ := json.MarshalIndent(i, "", "\t") pretty, _ := json.MarshalIndent(i, "", "\t")
fmt.Print(string(pretty)+"\n") fmt.Print(string(pretty) + "\n")
} }
} }

@ -24,7 +24,6 @@ func main() {
println("deleted " + strconv.Itoa(deleted) + " IPs successfully") println("deleted " + strconv.Itoa(deleted) + " IPs successfully")
println("adding current IP to all packages...") println("adding current IP to all packages...")
count := c.AddCurrentIPtoAllPackages() count := c.AddCurrentIPtoAllPackages()
if count == 0 { if count == 0 {

@ -6,7 +6,7 @@ import (
) )
var ( var (
Debug = false Debug = false
APIKey string APIKey string
) )