client

package
v0.0.0-...-0f4c570 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2018 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package client implements a remoting client for reflow pools.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	*rest.Client
	// contains filtered or unexported fields
}

Client implements a reflow pool by dispatching calls to a remote implementation.

func New

func New(baseurl string, client *http.Client, log *log.Logger) (*Client, error)

New creates a new Client which connects to a given host using the provided http.Client. If http.Client is nil, the default client is used. If logger is not nil, Client logs detailed request/response information to it.

func (*Client) Alloc

func (c *Client) Alloc(ctx context.Context, id string) (pool.Alloc, error)

Alloc looks and alloc up by name.

func (*Client) Allocs

func (c *Client) Allocs(ctx context.Context) ([]pool.Alloc, error)

Allocs enumerates all allocs available on the remote node.

func (*Client) ID

func (c *Client) ID() string

ID returns the client's host name.

func (*Client) Offer

func (c *Client) Offer(ctx context.Context, id string) (pool.Offer, error)

Offer looks up the offer named id.

func (*Client) Offers

func (c *Client) Offers(ctx context.Context) ([]pool.Offer, error)

Offers enumerates all available offers in this pool.

Jump to

Keyboard shortcuts

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