Skip to content

Latest commit

 

History

History
44 lines (30 loc) · 640 Bytes

README.md

File metadata and controls

44 lines (30 loc) · 640 Bytes

AH: A Go library for the Advanced Hosting API

The AH API documentation is available here.

Install

go get github.com/advancedhosters/advancedhosting-api-go

Usage

package main

import (
	"context"
	"log"

	"github.com/advancedhosting/advancedhosting-api-go/ah"
)

func main() {
	clientOptions := &ah.ClientOptions{
		Token: "ACCESS_TOKEN",
	}

	client, err := ah.NewAPIClient(clientOptions)

	if err != nil {
		panic(err)
	}

	ctx := context.Background()
	instances, _, err := client.Instances.List(ctx, nil)

	if err != nil {
		panic(err)
	}
	log.Printf("%v", instances)
}