Skip to content

Chirab/clevercloud-client-go

 
 

Repository files navigation

Go CleverCloud API client

Go Reference

How to

Installation

Add this client as project dependency

go get -u go.clever-cloud.dev/client

Usage

Client instantiation

import "go.clever-cloud.dev/client"

cc := client.New(
    client.WithAutoOauthConfig(),
) 

Use the client

type Self struct {
    ID string `json:"id"`
}

res := client.Get[Self](context.Background(), cc, "/v2/self")
if res.HasError() {
    // handle res.Error()
}

fmt.Prinln(res.Payload().ID)

if the operation you want to do does not return anything, use:

res := client.Get[client.Nothing](context.Background(), cc, "/v2/self")

About

Clever Cloud API Go client

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 98.8%
  • Makefile 1.2%