/go-pivnet

A golang libary for Pivotal Network.

Primary LanguageGoApache License 2.0Apache-2.0

go-pivnet API library

A golang libary for Pivotal Network.

See also the pivnet-cli and the pivnet-resource.

Usage

See example for an executable example.

import github.com/pivotal-cf/pivnet

[...]

config := pivnet.ClientConfig{
  Host:      pivnet.DefaultHost,
  Token:     "token-from-pivnet",
  UserAgent: "user-agent",
}

stdoutLogger := log.New(os.Stdout, "", log.LstdFlags)
stderrLogger := log.New(os.Stderr, "", log.LstdFlags)

verbose := false
logger := logshim.NewLogShim(stdoutLogger, stderrLogger, verbose)

client := pivnet.NewClient(config, logger)

products, _ := client.Products.List()

fmt.Printf("products: %v", products)

Running the tests

Install the ginkgo executable with:

go get -u github.com/onsi/ginkgo/ginkgo

The tests require a valid Pivotal Network API token and host.

Refer to the official docs for more details on obtaining a Pivotal Network API token.

It is advised to run the acceptance tests against the Pivotal Network integration environment endpoint i.e. HOST='https://pivnet-integration.cfapps.io'.

Run the tests with the following command:

API_TOKEN=my-token \
HOST='https://pivnet-integration.cfapps.io' \
./bin/test_all

Contributing

Please make all pull requests to the develop branch, and ensure the tests pass locally.

Project management

The CI for this project can be found at https://sunrise.ci.cf-app.com and the scripts can be found in the pivnet-resource-ci repo.

The roadmap is captured in Pivotal Tracker.