mirror of
https://codeberg.org/ultimateplayer1999/go-api-usage.git
synced 2025-07-15 12:09:43 -04:00
Compare commits
4 Commits
4faecc1444
...
main
Author | SHA1 | Date | |
---|---|---|---|
ace4c7e53f
|
|||
571a1bc3a7
|
|||
754585842a
|
|||
99f5658469
|
21
keystatus.go
21
keystatus.go
@ -61,8 +61,19 @@ func main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Print the response
|
// Print the response
|
||||||
fmt.Println("")
|
if resp.StatusCode == http.StatusOK {
|
||||||
fmt.Println("Key expire fulldate: ", r.KeyexpireString)
|
fmt.Println("")
|
||||||
fmt.Println("Key expire date: ", r.ExpireDate)
|
fmt.Println("Key status: Active")
|
||||||
fmt.Println("")
|
fmt.Println("Key expire fulldate: ", r.KeyexpireString)
|
||||||
}
|
fmt.Println("Key expire date: ", r.ExpireDate)
|
||||||
|
fmt.Println("")
|
||||||
|
} else if resp.StatusCode == http.StatusUnauthorized {
|
||||||
|
fmt.Println("")
|
||||||
|
fmt.Println("Key status: Expired")
|
||||||
|
fmt.Println("")
|
||||||
|
} else {
|
||||||
|
fmt.Println("")
|
||||||
|
fmt.Println("Recieved an other status code.")
|
||||||
|
fmt.Println("")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -14,7 +14,7 @@ import (
|
|||||||
type Response struct {
|
type Response struct {
|
||||||
Action string `json:"action"`
|
Action string `json:"action"`
|
||||||
Completed string `json:"completed"`
|
Completed string `json:"completed"`
|
||||||
NewAPIKey int `json:"newAPIKey"`
|
NewAPIKey string `json:"newAPIKey"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
Reference in New Issue
Block a user