api

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2018 License: Apache-2.0 Imports: 22 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrConnectionRefused = errors.New("Cannot connect to the Hyper daemon. Is 'hyperd' running on this host?")
)

Functions

This section is empty.

Types

type APIInterface

type APIInterface interface {
	Login(auth dockertypes.AuthConfig, response *dockertypes.AuthResponse) (remove bool, err error)

	Attach(container string, tty bool, stdin io.ReadCloser, stdout, stderr io.Writer) error
	CreateExec(containerId string, command []byte, tty bool) (string, error)
	StartExec(containerId, execId string, tty bool, stdin io.ReadCloser, stdout, stderr io.Writer) error
	ExecVM(podID string, command []byte, stdin io.ReadCloser, stdout, stderr io.Writer) error

	WinResize(id, tag string, height, width int) error

	List(item, pod, vm string) (*engine.Env, error)
	CreateContainer(podID string, spec interface{}) (string, int, error)
	StartContainer(container string) error
	GetContainerInfo(container string) (*types.ContainerInfo, error)
	GetContainerByPod(podId string) (string, error)
	GetExitCode(container, tag string, wait bool) error
	ContainerLogs(container, since string, timestamp, follow, stdout, stderr bool, tail string) (io.ReadCloser, string, error)
	KillContainer(container string, sig int) error
	StopContainer(container string) error
	RemoveContainer(container string) error

	GetPodInfo(podName string) (*types.PodInfo, error)
	CreatePod(spec interface{}) (string, int, error)
	StartPod(podId string) error
	StopPod(podId, stopVm string) (int, string, error)
	RmPod(id string) error
	PausePod(podId string) error
	UnpausePod(podId string) error
	KillPod(pod string, sig int) error

	// PortMapping APIs
	ListPortMappings(podId string) ([]*types.PortMapping, error)
	AddPortMappings(podId string, pms []*types.PortMapping) error
	DeletePortMappings(podId string, pms []*types.PortMapping) error

	Build(name string, hasBody bool, body io.Reader) (io.ReadCloser, string, error)
	Commit(container, repo, author, message string, changes []string, pause bool) (string, error)
	Load(body io.Reader, name string, refs map[string]string) (io.ReadCloser, string, error)
	Save(imageIDs []string, format string, refs map[string]string) (io.ReadCloser, error)
	GetImages(all, quiet bool) (*engine.Env, error)
	RemoveImage(image string, noprune, force bool) (*engine.Env, error)
	Pull(image string, authConfig dockertypes.AuthConfig) (io.ReadCloser, string, int, error)
	Push(tag, repo string, authConfig dockertypes.AuthConfig) (io.ReadCloser, string, int, error)

	CreateVm(cpu, mem int, async bool) (id string, err error)
	RmVm(vm string) (err error)

	Info() (*engine.Env, error)
}

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(proto, addr string, tlsConfig *tls.Config) *Client

func (*Client) AddPortMappings added in v1.0.0

func (c *Client) AddPortMappings(podId string, pms []*types.PortMapping) error

func (*Client) Attach

func (cli *Client) Attach(container string, tty bool, stdin io.ReadCloser, stdout, stderr io.Writer) error

func (*Client) AuthHeader

func (cli *Client) AuthHeader(orig map[string][]string, auth types.AuthConfig) (map[string][]string, error)

func (*Client) Build

func (cli *Client) Build(name string, hasBody bool, body io.Reader) (io.ReadCloser, string, error)

func (*Client) Commit

func (cli *Client) Commit(container, repo, author, message string, changes []string, pause bool) (string, error)

func (*Client) ContainerLogs

func (cli *Client) ContainerLogs(container, since string, timestamp, follow, stdout, stderr bool, tail string) (io.ReadCloser, string, error)

func (*Client) CreateContainer added in v0.6.2

func (cli *Client) CreateContainer(podID string, spec interface{}) (string, int, error)

func (*Client) CreateExec added in v0.6.2

func (cli *Client) CreateExec(container string, command []byte, tty bool) (string, error)

func (*Client) CreatePod

func (cli *Client) CreatePod(spec interface{}) (string, int, error)

func (*Client) CreateVm

func (cli *Client) CreateVm(cpu, mem int, async bool) (id string, err error)

func (*Client) DeletePortMappings added in v1.0.0

func (c *Client) DeletePortMappings(podId string, pms []*types.PortMapping) error

func (*Client) ExecVM added in v0.8.0

func (cli *Client) ExecVM(podID string, command []byte, stdin io.ReadCloser, stdout, stderr io.Writer) error

func (*Client) GetContainerByPod

func (cli *Client) GetContainerByPod(podId string) (string, error)

func (*Client) GetContainerInfo

func (cli *Client) GetContainerInfo(container string) (*types.ContainerInfo, error)

func (*Client) GetExitCode

func (cli *Client) GetExitCode(containerId, execId string, wait bool) error

func (*Client) GetImages

func (cli *Client) GetImages(all, quiet bool) (*engine.Env, error)

func (*Client) GetPodInfo

func (cli *Client) GetPodInfo(podName string) (*types.PodInfo, error)

func (*Client) HTTPClient

func (cli *Client) HTTPClient() *http.Client

func (*Client) Info

func (cli *Client) Info() (*engine.Env, error)

func (*Client) KillContainer

func (cli *Client) KillContainer(container string, sig int) error

func (*Client) KillPod

func (cli *Client) KillPod(pod string, sig int) error

func (*Client) List

func (cli *Client) List(item, pod, vm string) (*engine.Env, error)

func (*Client) ListPortMappings added in v1.0.0

func (c *Client) ListPortMappings(podId string) ([]*types.PortMapping, error)

func (*Client) Load

func (cli *Client) Load(body io.Reader, name string, refs map[string]string) (io.ReadCloser, string, error)

func (*Client) Login

func (cli *Client) Login(auth types.AuthConfig, response *types.AuthResponse) (remove bool, err error)

func (*Client) PausePod

func (cli *Client) PausePod(podId string) error

func (*Client) Pull

func (cli *Client) Pull(image string, authConfig types.AuthConfig) (io.ReadCloser, string, int, error)

func (*Client) Push

func (cli *Client) Push(tag, repo string, authConfig types.AuthConfig) (io.ReadCloser, string, int, error)

func (*Client) RemoveContainer added in v0.8.0

func (cli *Client) RemoveContainer(container string) error

func (*Client) RemoveImage

func (cli *Client) RemoveImage(image string, noprune, force bool) (*engine.Env, error)

func (*Client) RmPod

func (cli *Client) RmPod(id string) error

func (*Client) RmVm

func (cli *Client) RmVm(vm string) (err error)

func (*Client) Save added in v0.8.0

func (cli *Client) Save(imageIDs []string, format string, refs map[string]string) (io.ReadCloser, error)

func (*Client) StartContainer added in v0.8.0

func (cli *Client) StartContainer(container string) error

func (*Client) StartExec added in v0.6.2

func (cli *Client) StartExec(containerId, execId string, tty bool, stdin io.ReadCloser, stdout, stderr io.Writer) error

func (*Client) StartPod

func (cli *Client) StartPod(podId string) error

func (*Client) StopContainer added in v0.6.2

func (cli *Client) StopContainer(container string) error

func (*Client) StopPod

func (cli *Client) StopPod(podId, stopVm string) (int, string, error)

func (*Client) UnpausePod

func (cli *Client) UnpausePod(podId string) error

func (*Client) WinResize

func (cli *Client) WinResize(containerId, execId string, height, width int) error

type PortMappingList added in v1.0.0

type PortMappingList struct {
	PortMappings []*types.PortMapping `json:"portMappings"`
}

type StatusError

type StatusError struct {
	Status     string
	StatusCode int
}

An StatusError reports an unsuccessful exit by a command.

func (StatusError) Error

func (e StatusError) Error() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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