8000 GitHub - Rid/leasewebgo
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Rid/leasewebgo

Repository files navigation

leasewebgo

A Golang client for the Leaseweb API.

Installation

To import this library into your Go project:

import "github.com/rid/leasewebgo"

Note: A minimum of Go 1.14 is required for development.

Download module with:

go get github.com/rid/leasewebgo

Stability and Compatibility

Leasewebgo is currently provided with a major version of v0. We'll try to avoid breaking changes to this library, but they will certainly happen as we work towards a stable v1 library. See CHANGELOG.md for details on the latest additions, removals, fixes, and breaking changes.

While leasewebgo provides an interface to most of the LeaseWeb API, the API is regularly adding new features. To request or contribute support for more API end-points or added fields, create an issue.

Usage

To authenticate to the Equinix Metal API, you must have your API token exported in env var LEASEWEB_AUTH_TOKEN.

This code snippet initializes Equinix Metal API client, and lists your Projects:

package main

import (
	"log"

	"github.com/rid/leasewebgo"
)

func main() {
	c, err := leasewebgo.NewClient()
	if err != nil {
		log.Fatal(err)
	}

	bms, _, err := c.bareMetals.List(nil)
	if err != nil {
		log.Fatal(err)
	}
	for _, bm := range bms {
		log.Println(bm.ip, bm.macAddress)
	}
}

Contributing

See CONTIBUTING.md.

About

No description, website, or topics provided.

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 33

0