api

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2019 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

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

API interact with dockerd http api

func Create

func Create(host string, port string) (*API, error)

Create a API

func MustCreate

func MustCreate(host string, port string) *API

MustCreate a api object, panic if not

func (*API) Build

func (api *API) Build(project types.Project) (types.Service, error)

Build build a project

func (*API) BuildImage

func (api *API) BuildImage(tarFile string, tag string, labels map[string]string) error

BuildImage build docker image

func (*API) Call

func (api *API) Call(file string, param string, project types.Project) error

Call function directly with given params

func (*API) ContainerWait

func (api *API) ContainerWait(
	ctx context.Context,
	containerID string,
	condition container.WaitCondition,
	timeout time.Duration,
) (<-chan container.ContainerWaitOKBody, <-chan error)

ContainerWait waits until the specified container is in a certain state indicated by the given condition, either "not-running" (default), "next-exit", or "removed".

If this client's API version is before 1.30, condition is ignored and ContainerWait will return immediately with the two channels, as the server will wait as if the condition were "not-running".

If this client's API version is at least 1.30, ContainerWait blocks until the request has been acknowledged by the server (with a response header), then returns two channels on which the caller can wait for the exit status of the container or an error if there was a problem either beginning the wait request or in getting the response. This allows the caller to synchronize ContainerWait with other calls, such as specifying a "next-exit" condition before issuing a ContainerStart request.

func (*API) CreateNetwork

func (api *API) CreateNetwork(name string) error

CreateNetwork create a network

func (*API) Down

func (api *API) Down(names []string) error

Down destroy services

func (*API) GetNetwork

func (api *API) GetNetwork(name string) ([]dockerTypes.NetworkResource, error)

GetNetwork get a network

func (*API) List

func (api *API) List(name string) error

List services

func (*API) Run

func (api *API) Run(port int, service *types.Service) error

Run a service

func (*API) Stop

func (api *API) Stop(name string) error

Stop a container by name

func (*API) Up

func (api *API) Up(opt UpOptions) error

Up up a source code of function to be a service

type ContainerCreateRequestPayload

type ContainerCreateRequestPayload struct {
	*container.Config
	HostConfig       *container.HostConfig
	NetworkingConfig *network.NetworkingConfig
}

ContainerCreateRequestPayload request paylaod

type UpOptions

type UpOptions struct {
	Body       []byte
	Lang       string
	Name       string
	Port       int
	HealtCheck bool
	Project    types.Project
}

UpOptions options for up

Jump to

Keyboard shortcuts

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