request

package
v5.1.0+incompatible Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CloudService

type CloudService int

CloudService indicates the cloud service a request is associated with

const (
	// CloudServiceAPI is the Cloud API service
	CloudServiceAPI CloudService = iota
	// CloudServiceProvision is the Cloud Provision service
	CloudServiceProvision
	// CloudServiceAuth is the Cloud Auth service
	CloudServiceAuth
)

func (CloudService) BaseURL

func (s CloudService) BaseURL() string

BaseURL returns the url associated with the cloud service

func (CloudService) String

func (s CloudService) String() string

String converts this CloudService to its string representation

type Requester

type Requester struct {
	// contains filtered or unexported fields
}

Requester returns an object that can be used for making requests to the containership cloud api

func New

func New(service CloudService, path, method string, body []byte) (*Requester, error)

New returns a Requester with the endpoint and type or request set that is needed to be made

func (*Requester) AddHeader

func (r *Requester) AddHeader(key, value string)

AddHeader allows the user to add custom headers to the req property of a requester

func (*Requester) Do

func (r *Requester) Do() (*http.Response, error)

Do makes a request using the req property of the requester

func (*Requester) MakeRequest

func (r *Requester) MakeRequest() (*http.Response, error)

MakeRequest builds a request that is able to speak with the Containership API

Jump to

Keyboard shortcuts

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