The Go implementation of the StatusCake API client. Documentation for this library can be found here.
You will need the following things properly installed on your computer.
With Go module support (Go 1.11+), add the following import
import "github.com/StatusCakeDev/statuscake-go"
to your code, and then go [build|run|test]
will automatically fetch the
necessary dependencies.
Otherwise, to install the statuscake-go
package, run the following command:
$ go get -u github.com/StatusCakeDev/statuscake-go
Within any Go file instantiate an API client and execute a request:
package main
import (
"context"
"fmt"
"github.com/StatusCakeDev/statuscake-go"
"github.com/StatusCakeDev/statuscake-go/credentials"
)
func main() {
bearer := credentials.NewBearerWithStaticToken(apiToken)
client := statuscake.NewClient(statuscake.WithRequestCredentials(bearer))
tests, err := client.ListUptimeTests(context.Background()).Execute()
if err != nil {
panic(err)
}
fmt.Printg("%+v\n", tests.Data)
This project is licensed under the MIT License.