client

package
v0.17.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

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

WasNotFoundError 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)

NewClient returns a new client

func (*Client) BuildMultipartFormRequest added in v0.8.0

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

BuildMultipartFormRequest builds a new HTTP Request for a multipart form request from specifies attributes

func (*Client) BuildNonJSONRequest added in v0.3.0

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

BuildNonJSONRequest builds 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)

BuildRequestBody 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) DebugLogString

func (c *Client) DebugLogString(str string)

DebugLogString logs a string if debug logs are on

func (*Client) ExecuteRequest

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

ExecuteRequest 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)

MarshallRequestBody 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

WaitFor - Retry function

Jump to

Keyboard shortcuts

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