A golang library for Pivotal Network.
NOTE This library is intended to be used by pivnet-cli and pivnet-resource. If you are using this library on its own, be aware of possible breaking changes following new releases of pivnet-cli/resource.
See also: pivnet-cli and pivnet-resource.
See example for an executable example.
import pivnet github.com/pivotal-cf/go-pivnet/v7
[...]
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
NOTE
- If dependencies are not correct, the tests may not run correctly. You will have to run
GO111MODULE=on go mod vendor
first in this case.
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.