mirror of
https://codeberg.org/ultimateplayer1999/go-api-usage.git
synced 2025-07-15 16:49:43 -04:00
Compare commits
6 Commits
956c07e85c
...
main
Author | SHA1 | Date | |
---|---|---|---|
ace4c7e53f
|
|||
571a1bc3a7
|
|||
754585842a
|
|||
99f5658469
|
|||
4faecc1444
|
|||
b0951e95b5
|
13
README.md
13
README.md
@ -1,3 +1,12 @@
|
||||
Some examples for API usage in Go for the ssh.surf API
|
||||
Some examples for API usage in Go for the ssh.surf API.
|
||||
|
||||
All of them based on .env files
|
||||
All of them based on a .env file.
|
||||
|
||||
To install this package you can use the following while you have it setup for a Go project.
|
||||
|
||||
```text
|
||||
go get github.com/joho/godotenv
|
||||
```
|
||||
|
||||
# DISCLAIMER
|
||||
The binaries may need to be rebuild. As they are build on Ubuntu and it may also depends on how you installed Golang.
|
||||
|
21
keystatus.go
21
keystatus.go
@ -61,8 +61,19 @@ func main() {
|
||||
}
|
||||
|
||||
// Print the response
|
||||
fmt.Println("")
|
||||
fmt.Println("Key expire fulldate: ", r.KeyexpireString)
|
||||
fmt.Println("Key expire date: ", r.ExpireDate)
|
||||
fmt.Println("")
|
||||
}
|
||||
if resp.StatusCode == http.StatusOK {
|
||||
fmt.Println("")
|
||||
fmt.Println("Key status: Active")
|
||||
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("")
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user