vanstee / heroku-go

Heroku Platform API Go Client

Home Page:https://godoc.org/github.com/cyberdelia/heroku-go

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Heroku Platform API

GoDoc

An API client interface for Heroku Platform API for the Go (golang) programming language.

Usage

$ go mod init myproj
$ cd myproj

Example

package main

import (
	"context"
	"flag"
	"fmt"
	"log"

	heroku "github.com/heroku/heroku-go/v5"
)

var (
	username = flag.String("username", "", "api username")
	password = flag.String("password", "", "api password")
)

func main() {
	log.SetFlags(0)
	flag.Parse()

	heroku.DefaultTransport.Username = *username
	heroku.DefaultTransport.Password = *password

	h := heroku.NewService(heroku.DefaultClient)
	addons, err := h.AddOnList(context.TODO(), &heroku.ListRange{Field: "name"})
	if err != nil {
		log.Fatal(err)
	}
	for _, addon := range addons {
		fmt.Println(addon.Name)
	}
}
$ go build

About

Heroku Platform API Go Client

https://godoc.org/github.com/cyberdelia/heroku-go

License:MIT License


Languages

Language:Go 99.5%Language:Shell 0.3%Language:Makefile 0.1%