pivnet

package
v0.93.0 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrDecodingURLRequest                 = stringError("error while decoding the url")
	ErrCouldNotCreateRequest              = stringError("could not create valid http request")
	ErrProductSlugMustNotBeEmpty          = stringError("product slug must not be empty")
	ErrStemcellMajorVersionMustNotBeEmpty = stringError("stemcell major version must not be empty")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Release

type Release struct {
	Version string `json:"version"`
	ID      int    `json:"id"`
}

type Service

type Service struct {
	// Target defaults to the public deployed endpoint.
	// It can be set to another host, for example the
	// network.pivotal.io's staging host.
	Target string

	// UAAAPIToken should be set with the token for the "UAA API Token Workflow"
	// See: https://network.pivotal.io/docs/api#authentication
	UAAAPIToken string

	// Client allows you to inject an alternate client
	// (for testing per se). When not set, http.DefaultClient is used.
	Client *http.Client
}

Service wraps requests to network.pivotal.io.

func (Service) Do

func (service Service) Do(req *http.Request) (*http.Response, error)

Do sets required headers for requests to network.pivotal.io. If service.Client is nil, it uses http.DefaultClient.

func (Service) Releases

func (service Service) Releases(productSlug string) ([]Release, error)

func (*Service) SetToken added in v0.71.0

func (service *Service) SetToken(token string)

Jump to

Keyboard shortcuts

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