Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/statuscakedev/statuscake-go
StatusCake Go SDK
https://github.com/statuscakedev/statuscake-go
api-client statuscake
Last synced: about 2 months ago
JSON representation
StatusCake Go SDK
- Host: GitHub
- URL: https://github.com/statuscakedev/statuscake-go
- Owner: StatusCakeDev
- License: mit
- Created: 2021-08-25T21:02:37.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2024-08-07T13:06:37.000Z (5 months ago)
- Last Synced: 2024-08-07T15:49:28.324Z (5 months ago)
- Topics: api-client, statuscake
- Homepage: https://developers.statuscake.com
- Size: 271 KB
- Stars: 8
- Watchers: 3
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
- Code of conduct: CODE_OF_CONDUCT.md
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# statuscake-go ![test](https://github.com/StatusCakeDev/statuscake-go/workflows/test/badge.svg)
The [Go](https://golang.org/) implementation of the [StatusCake
API](https://www.statuscake.com/api/v1) client. Documentation for this library
can be found [here](https://www.statuscake.com/api/v1).## Prerequisites
You will need the following things properly installed on your computer:
- [Go](https://golang.org/): any one of the **three latest major**
[releases](https://golang.org/doc/devel/release.html)## Installation
With [Go module](https://github.com/golang/go/wiki/Modules) support (Go 1.11+),
add the following import```go
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:
```bash
go get -u github.com/StatusCakeDev/statuscake-go
```## Usage
Within any Go file instantiate an API client and execute a request:
```go
package mainimport (
"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.Printf("%+v\n", tests.Data)
}
```## License
This project is licensed under the [MIT License](LICENSE).