1
0
mirror of https://github.com/woodpecker-ci/woodpecker.git synced 2024-12-18 08:26:45 +02:00
woodpecker/vendor/github.com/samalba/dockerclient/interface.go

67 lines
3.1 KiB
Go
Raw Normal View History

2015-05-22 20:37:40 +02:00
package dockerclient
import (
"io"
)
type Callback func(*Event, chan error, ...interface{})
2015-09-30 03:21:17 +02:00
type StatCallback func(string, *Stats, chan error, ...interface{})
2015-05-22 20:37:40 +02:00
type Client interface {
Info() (*Info, error)
ListContainers(all, size bool, filters string) ([]Container, error)
InspectContainer(id string) (*ContainerInfo, error)
2015-09-30 03:21:17 +02:00
InspectImage(id string) (*ImageInfo, error)
2016-03-07 21:23:49 +02:00
CreateContainer(config *ContainerConfig, name string, authConfig *AuthConfig) (string, error)
2015-05-22 20:37:40 +02:00
ContainerLogs(id string, options *LogOptions) (io.ReadCloser, error)
2015-09-30 03:21:17 +02:00
ContainerChanges(id string) ([]*ContainerChanges, error)
2016-03-07 21:23:49 +02:00
// ContainerStats takes a container ID and an optional stop channel and
// returns a StatsOrError channel. If an error is ever sent, then no
// more stats will be sent on that channel. If a stop channel is
// provided, events will stop being monitored after the stop channel is
// closed.
ContainerStats(id string, stopChan <-chan struct{}) (<-chan StatsOrError, error)
ExecCreate(config *ExecConfig) (string, error)
ExecStart(id string, config *ExecConfig) error
ExecResize(id string, width, height int) error
2015-05-22 20:37:40 +02:00
StartContainer(id string, config *HostConfig) error
2016-03-07 21:23:49 +02:00
AttachContainer(id string, options *AttachOptions) (io.ReadCloser, error)
2015-05-22 20:37:40 +02:00
StopContainer(id string, timeout int) error
RestartContainer(id string, timeout int) error
KillContainer(id, signal string) error
2015-09-30 03:21:17 +02:00
Wait(id string) <-chan WaitResult
// MonitorEvents takes options and an optional stop channel, and returns
// an EventOrError channel. If an error is ever sent, then no more
// events will be sent. If a stop channel is provided, events will stop
// being monitored after the stop channel is closed.
MonitorEvents(options *MonitorEventsOptions, stopChan <-chan struct{}) (<-chan EventOrError, error)
2015-05-22 20:37:40 +02:00
StartMonitorEvents(cb Callback, ec chan error, args ...interface{})
StopAllMonitorEvents()
2015-09-30 03:21:17 +02:00
StartMonitorStats(id string, cb StatCallback, ec chan error, args ...interface{})
StopAllMonitorStats()
TagImage(nameOrID string, repo string, tag string, force bool) error
2015-05-22 20:37:40 +02:00
Version() (*Version, error)
PullImage(name string, auth *AuthConfig) error
2016-03-07 21:23:49 +02:00
PushImage(name string, tag string, auth *AuthConfig) error
2015-09-30 03:21:17 +02:00
LoadImage(reader io.Reader) error
2015-05-22 20:37:40 +02:00
RemoveContainer(id string, force, volumes bool) error
2015-09-30 03:21:17 +02:00
ListImages(all bool) ([]*Image, error)
2016-03-07 21:23:49 +02:00
RemoveImage(name string, force bool) ([]*ImageDelete, error)
SearchImages(query, registry string, auth *AuthConfig) ([]ImageSearch, error)
2015-05-22 20:37:40 +02:00
PauseContainer(name string) error
UnpauseContainer(name string) error
2015-09-30 03:21:17 +02:00
RenameContainer(oldName string, newName string) error
ImportImage(source string, repository string, tag string, tar io.Reader) (io.ReadCloser, error)
BuildImage(image *BuildImage) (io.ReadCloser, error)
2016-03-07 21:23:49 +02:00
ListVolumes() ([]*Volume, error)
RemoveVolume(name string) error
CreateVolume(request *VolumeCreateRequest) (*Volume, error)
ListNetworks(filters string) ([]*NetworkResource, error)
InspectNetwork(id string) (*NetworkResource, error)
CreateNetwork(config *NetworkCreate) (*NetworkCreateResponse, error)
ConnectNetwork(id, container string) error
DisconnectNetwork(id, container string, force bool) error
RemoveNetwork(id string) error
2015-05-22 20:37:40 +02:00
}