https://github.com/dansmaculotte/clevercloud-go
[WIP] Go library for Clever Cloud v2 API
https://github.com/dansmaculotte/clevercloud-go
clevercloud go
Last synced: 5 months ago
JSON representation
[WIP] Go library for Clever Cloud v2 API
- Host: GitHub
- URL: https://github.com/dansmaculotte/clevercloud-go
- Owner: dansmaculotte
- License: mit
- Created: 2019-09-02T11:19:45.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-11-09T21:06:02.000Z (about 6 years ago)
- Last Synced: 2025-01-28T11:32:09.773Z (11 months ago)
- Topics: clevercloud, go
- Language: Go
- Homepage:
- Size: 19.5 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: ReadMe.md
Awesome Lists containing this project
README
# clevercloud-go
> A Go library for interacting with [Clever Cloud's API](https://www.clever-cloud.com/doc/clever-cloud-apis/cc-api/).
## Installation
```bash
go get github.com/dansmaculotte/clevercloud-go/clevercloud
```
## OAuth
Generate an `accessToken` and `accessSecret` with [Clever Cloud CLI OAuth](https://console.clever-cloud.com/cli-oauth).
## Usage
To properly request a resource you need a fresh new client instance:
```go
import "github.com/dansmaculotte/clevercloud-go/clevercloud"
config := &clevercloud.Config{
Token: "mytoken",
Secret: "mysecret"
}
// or get config from $HOME/.config/clever-cloud
config = clevercloud.GetConfigFromUser()
// or get config from env with CLEVER_TOKEN and CLEVER_SECRET
config = clevercloud.GetConfigFromEnv()
client := clevercloud.NewClient(config, &http.Client{})
```