client

package
v0.0.0-...-90deddd Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2023 License: Apache-2.0 Imports: 17 Imported by: 2

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 up an alloc 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) Config

func (c *Client) Config(ctx context.Context) (infra.Keys, error)

Config retrieves the reflowlet instance's reflow config.

func (*Client) ExecImage

func (c *Client) ExecImage(ctx context.Context) (digest.Digest, error)

ExecImage retrieves the reflowlet instance's executable image info.

func (*Client) ID

func (c *Client) ID() string

ID returns the client's host name.

func (*Client) InstallImage

func (c *Client) InstallImage(ctx context.Context, d digest.Digest) error

InstallImage instructs the reflowlet instance to install and run a new image. The image is referenced by the digest (in a format returned by digest.String()) and is expected to exist in the repository (or the call will fail).

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