client

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2018 License: MPL-2.0 Imports: 14 Imported by: 12

Documentation

Index

Constants

View Source
const DEFAULT_MAX_RETRIES = 1
View Source
const USER_AGENT_HEADER = "User-Agent"

Variables

This section is empty.

Functions

func Version added in v0.6.2

func Version() string

Version returns the semantic version (see http://semver.org).

func WasNotFoundError

func WasNotFoundError(e error) bool

Used to determine if the checked resource was found or not.

Types

type Client

type Client struct {
	IdentityDomain *string
	UserName       *string
	Password       *string
	APIEndpoint    *url.URL

	MaxRetries *int
	UserAgent  *string
	// contains filtered or unexported fields
}

Client represents an authenticated compute client, with compute credentials and an api client.

func NewClient

func NewClient(c *opc.Config) (*Client, error)

func (*Client) BuildMultipartFormRequest added in v0.8.0

func (c *Client) BuildMultipartFormRequest(method, path string, files map[string]string, parameters map[string]interface{}) (*http.Request, error)

Builds a new HTTP Request for a multipart form request

func (*Client) BuildNonJSONRequest added in v0.3.0

func (c *Client) BuildNonJSONRequest(method, path string, body io.ReadSeeker) (*http.Request, error)

Build a new HTTP request that doesn't marshall the request body

func (*Client) BuildRequestBody added in v0.4.0

func (c *Client) BuildRequestBody(method, path string, body []byte) (*http.Request, error)

Builds an HTTP Request that accepts a pre-marshaled body parameter as a raw byte array Returns the raw HTTP Request and any error occured

func (*Client) DebugLogReq

func (c *Client) DebugLogReq(req *http.Request)

func (*Client) DebugLogString

func (c *Client) DebugLogString(str string)

Log a string if debug logs are on

func (*Client) ExecuteRequest

func (c *Client) ExecuteRequest(req *http.Request) (*http.Response, error)

This method executes the http.Request from the BuildRequest method. It is split up to add additional authentication that is Oracle API dependent.

func (*Client) MarshallRequestBody added in v0.4.0

func (c *Client) MarshallRequestBody(body interface{}) ([]byte, error)

Marshalls the request body and returns the resulting byte slice This is split out of the BuildRequestBody method so as to allow the developer to print a debug string of the request body if they should so choose.

func (*Client) WaitFor

func (c *Client) WaitFor(description string, pollInterval, timeout time.Duration, test func() (bool, error)) error

Retry function

Jump to

Keyboard shortcuts

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