heroku-go

module
v3.0.0+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 3, 2019 License: MIT

README

Heroku Platform API

GoDoc

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

Installation

To download, build, and install the package:

$ go get github.com/heroku/heroku-go/v3

Example

package main

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

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

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)
	}
}

Directories

Path Synopsis
Generated service client for heroku API.
Generated service client for heroku API.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL