A golang libary for Pivotal Network.
See also the pivnet-cli and the pivnet-resource.
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)
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
Please make all pull requests to the develop
branch, and
ensure the tests pass locally.
The CI for this project can be found here and the scripts can be found in the pivnet-resource-ci repo.
The roadmap is captured in Pivotal Tracker.