Documentation ¶
Index ¶
- Variables
- func IsRegularError(err error) bool
- func IsSoapFault(err error) bool
- func IsVimFault(err error) bool
- func ParseURL(s string) (*url.URL, error)
- func ToRegularError(err error) error
- func ToVimFault(err error) types.BaseMethodFault
- func Wrap(err error) error
- func WrapRegularError(err error) error
- func WrapSoapFault(f *Fault) error
- func WrapVimFault(v types.BaseMethodFault) error
- type Client
- func (c *Client) CloseIdleConnections()
- func (c *Client) Download(u *url.URL, param *Download) (io.ReadCloser, int64, error)
- func (c *Client) DownloadFile(file string, u *url.URL, param *Download) error
- func (c *Client) MarshalJSON() ([]byte, error)
- func (c *Client) ParseURL(urlStr string) (*url.URL, error)
- func (c *Client) RoundTrip(ctx context.Context, reqBody, resBody HasFault) error
- func (c *Client) SetCertificate(cert tls.Certificate)
- func (c *Client) URL() *url.URL
- func (c *Client) UnmarshalJSON(b []byte) error
- func (c *Client) Upload(f io.Reader, u *url.URL, param *Upload) error
- func (c *Client) UploadFile(file string, u *url.URL, param *Upload) error
- type Download
- type Envelope
- type Fault
- type HasFault
- type Header
- type RoundTripper
- type Upload
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultDownload = Download{
Method: "GET",
}
View Source
var DefaultUpload = Upload{
Type: "application/octet-stream",
Method: "PUT",
}
View Source
var DefaultVimNamespace = "urn:vim25"
View Source
var DefaultVimVersion = "6.0"
Functions ¶
func IsRegularError ¶
func IsSoapFault ¶
func IsVimFault ¶
func ParseURL ¶
ParseURL is wrapper around url.Parse, where Scheme defaults to "https" and Path defaults to "/sdk"
func ToRegularError ¶
func ToVimFault ¶
func ToVimFault(err error) types.BaseMethodFault
func WrapRegularError ¶
func WrapSoapFault ¶
func WrapVimFault ¶
func WrapVimFault(v types.BaseMethodFault) error
Types ¶
type Client ¶
type Client struct { http.Client Namespace string // Vim namespace Version string // Vim version // contains filtered or unexported fields }
func (*Client) CloseIdleConnections ¶
func (c *Client) CloseIdleConnections()
func (*Client) DownloadFile ¶
DownloadFile GETs the given URL to a local file
func (*Client) MarshalJSON ¶
func (*Client) ParseURL ¶
ParseURL wraps url.Parse to rewrite the URL.Host field In the case of VM guest uploads or NFC lease URLs, a Host field with a value of "*" is rewritten to the Client's URL.Host.
func (*Client) SetCertificate ¶
func (c *Client) SetCertificate(cert tls.Certificate)
func (*Client) UnmarshalJSON ¶
type Fault ¶
type Fault struct { XMLName xml.Name `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault"` Code string `xml:"faultcode"` String string `xml:"faultstring"` Detail struct { Fault types.AnyType `xml:",any"` } `xml:"detail"` }
func ToSoapFault ¶
type RoundTripper ¶
Click to show internal directories.
Click to hide internal directories.