clevercloud-go

module
v1.0.0-alpha Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 12, 2021 License: Apache-2.0

README

clevercloud-go

Go Reference

A Go client for Clever Cloud

This client is generated by OpenAPI Generator tool.

Installation

go get github.com/clevercloud/clevercloud-go/clevercloud

Documentation

See generated ReadMe.md

Usage

To use the underlying API, you will need OAuth credentials, for further details please checkout our API documentation.

With those credentials you need to instantiate the OAuth client and build the API client with it:

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:

For example:

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)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL