client

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2017 License: MPL-2.0 Imports: 8 Imported by: 12

Documentation

Index

Constants

View Source
const DEFAULT_MAX_RETRIES = 1

Variables

This section is empty.

Functions

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
	// 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) BuildRequest

func (c *Client) BuildRequest(method, path string, body interface{}) (*http.Request, error)

This builds an http request. After calling this you need to add the authentication. Header/Cookie/etc Then call ExecuteRequest and pass in the return value of this method It is split up to add additional authentication that is Oracle API dependent.

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

func (c *Client) WaitFor(description string, timeoutSeconds int, 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