rest

package
v0.20.3 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	*soap.Client
}

Client extends soap.Client to support JSON encoding, while inheriting security features, debug tracing and session persistence.

func NewClient

func NewClient(c *vim25.Client) *Client

NewClient creates a new Client instance.

func (*Client) Do

func (c *Client) Do(ctx context.Context, req *http.Request, resBody interface{}) error

Do sends the http.Request, decoding resBody if provided.

func (*Client) Login

func (c *Client) Login(ctx context.Context, user *url.Userinfo) error

Login creates a new session via Basic Authentication with the given url.Userinfo.

func (*Client) LoginByToken added in v0.20.0

func (c *Client) LoginByToken(ctx context.Context) error

func (*Client) Logout

func (c *Client) Logout(ctx context.Context) error

Logout deletes the current session.

func (*Client) WithSigner added in v0.20.0

func (c *Client) WithSigner(ctx context.Context, s Signer) context.Context

type Signer added in v0.20.0

type Signer interface {
	SignRequest(*http.Request) error
}

Jump to

Keyboard shortcuts

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