Skip to content

einride/monta-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Monta Go SDK

Contributor Covenant

A Go SDK for the Monta Partner API.

Usage

Client

client := monta.NewClient(monta.WithClientIDAndSecret("<ID>", "<SECRET>")

GET /v1/auth/me

me, err := client.GetMe(ctx)
if err != nil {
	panic(err)
}
fmt.Println(me)

GET /v1/sites

response, err := client.ListSites(ctx, &monta.ListSitesRequest{
	Page:    1,
	PerPage: 10,
})
if err != nil {
	panic(err)
}
fmt.Println(response)

GET /v1/charge-points

response, err := client.ListChargePoints(ctx, &monta.ListChargePointsRequest{
	Page:    1,
	PerPage: 10,
})
if err != nil {
	panic(err)
}
fmt.Println(response)

CLI

Build

First you need to build the CLI - to create the monta CLI executable. Assuming you are on root level of the project:

$ cd cmd/monta
$ go build

Login

$ ./monta login --client-id <ID> --client-secret <SECRET>

GET /v1/auth/me

$ ./monta me

GET /v1/sites

$ ./monta sites

GET /v1/charge-points

$ ./monta charge-points