Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/CleverCloud/clevercloud-go
[Alpha] A Go client for Clever Cloud API
https://github.com/CleverCloud/clevercloud-go
clevercloud go golang
Last synced: 3 months ago
JSON representation
[Alpha] A Go client for Clever Cloud API
- Host: GitHub
- URL: https://github.com/CleverCloud/clevercloud-go
- Owner: CleverCloud
- License: apache-2.0
- Created: 2020-12-11T20:18:03.000Z (almost 4 years ago)
- Default Branch: 1.x
- Last Pushed: 2021-06-13T09:53:09.000Z (over 3 years ago)
- Last Synced: 2024-06-21T13:12:14.136Z (5 months ago)
- Topics: clevercloud, go, golang
- Language: Go
- Homepage:
- Size: 433 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: ReadMe.md
- License: LICENSE
Awesome Lists containing this project
- awesome-clever-cloud - Go (Alpha)
README
# clevercloud-go
[![Go Reference](https://pkg.go.dev/badge/github.com/clevercloud/clevercloud-go/clevercloud.svg)](https://pkg.go.dev/github.com/clevercloud/clevercloud-go/clevercloud)
> A Go client for Clever Cloud
This client is generated by [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) tool.
## Installation
```bash
go get github.com/clevercloud/clevercloud-go/clevercloud
```## Documentation
See generated [ReadMe.md](./clevercloud/ReadMe.md)
## Usage
To use the underlying API, you will need OAuth credentials, for further details please checkout our [API documentation](https://www.clever-cloud.com/doc/extend/cc-api/).
With those credentials you need to instantiate the OAuth client and build the API client with it:
```go
import "github.com/clevercloud/clevercloud-go/clevercloud"oauth := clevercloud.NewOAuthClient("myConsumerKey", "myConsumerSecret")
oauth.SetTokens("myCleverToken", "myCleverSecret")config := clevercloud.NewConfiguration()
api := clevercloud.NewOAuthAPIClient(oauth, config)
```Once you have an `api` object you can request any services provided by the client:
- [AuthApi](./clevercloud/docs/AuthApi.md)
- [DefaultApi](./clevercloud/docs/DefaultApi.md)
- [OrganisationApi](./clevercloud/docs/OrganisationApi.md)
- [PaymentApi](./clevercloud/docs/PaymentApi.md)
- [ProductsApi](./clevercloud/docs/ProductsApi.md)
- [SelfApi](./clevercloud/docs/SelfApi.md)
- [UserApi](./clevercloud/docs/UserApi.md)For example:
```go
resp, r, err := api.SelfApi.GetUser(context.Background())
if err != nil {
fmt.Printf("Error when calling `SelfApi.GetUser``: %v\n", err)return
}// response from `GetUser`: UserView
fmt.Printf("Response from `SelfApi.GetUser`: %v\n", resp)
```