docker

package
v0.0.0-...-9b4d37b Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContainerCreate

func ContainerCreate(cr *common.ContextRouter, c *gin.Context)

ContainerCreate - create a container. https://docs.docker.com/engine/api/v1.41/#operation/ContainerCreate POST "/containers/create"

func ContainerDelete

func ContainerDelete(cr *common.ContextRouter, c *gin.Context)

ContainerDelete - remove a container. https://docs.docker.com/engine/api/v1.41/#operation/ContainerDelete DELETE "/containers/:id"

func ContainerInfo

func ContainerInfo(cr *common.ContextRouter, c *gin.Context)

ContainerInfo - return low-level information about a container. https://docs.docker.com/engine/api/v1.41/#operation/ContainerInspect GET "/containers/:id/json"

func ContainerList

func ContainerList(cr *common.ContextRouter, c *gin.Context)

ContainerList - returns a list of containers. https://docs.docker.com/engine/api/v1.41/#operation/ContainerList GET "/containers/json"

func ContainerWait

func ContainerWait(cr *common.ContextRouter, c *gin.Context)

ContainerWait - Block until a container stops, then returns the exit code. https://docs.docker.com/engine/api/v1.41/#operation/ContainerWait POST "/containers/:id/wait"

func Events

func Events(cr *common.ContextRouter, c *gin.Context)

Events - Stream real-time events from the server. https://docs.docker.com/engine/api/v1.41/#tag/System/operation/SystemEvents GET "/events"

func ImageCreate

func ImageCreate(cr *common.ContextRouter, c *gin.Context)

ImageCreate - create an image. https://docs.docker.com/engine/api/v1.41/#operation/ImageCreate POST "/images/create"

func ImagesPrune

func ImagesPrune(cr *common.ContextRouter, c *gin.Context)

ImagesPrune - Delete unused images. https://docs.docker.com/engine/api/v1.41/#operation/ImagePrune POST "/images/prune"

func Info

func Info(cr *common.ContextRouter, c *gin.Context)

Info - get system information. https://docs.docker.com/engine/api/v1.41/#operation/SystemInfo GET "/info"

func NetworksConnect

func NetworksConnect(cr *common.ContextRouter, c *gin.Context)

NetworksConnect - connect a container to a network. https://docs.docker.com/engine/api/v1.41/#operation/NetworkConnect POST "/networks/:id/connect"

func NetworksCreate

func NetworksCreate(cr *common.ContextRouter, c *gin.Context)

NetworksCreate - create a network. https://docs.docker.com/engine/api/v1.41/#operation/NetworkCreate POST "/networks/create"

func NetworksDelete

func NetworksDelete(cr *common.ContextRouter, c *gin.Context)

NetworksDelete - remove a network. https://docs.docker.com/engine/api/v1.41/#operation/NetworkDelete DELETE "/networks/:id"

func NetworksDisconnect

func NetworksDisconnect(cr *common.ContextRouter, c *gin.Context)

NetworksDisconnect - connect a container to a network. https://docs.docker.com/engine/api/v1.41/#operation/NetworkDisconnect POST "/networks/:id/disconnect"

func NetworksInfo

func NetworksInfo(cr *common.ContextRouter, c *gin.Context)

NetworksInfo - inspect a network. https://docs.docker.com/engine/api/v1.41/#operation/NetworkInspect GET "/network/:id"

func NetworksList

func NetworksList(cr *common.ContextRouter, c *gin.Context)

NetworksList - list networks. https://docs.docker.com/engine/api/v1.41/#operation/NetworkList GET "/networks"

func NetworksPrune

func NetworksPrune(cr *common.ContextRouter, c *gin.Context)

NetworksPrune - delete unused networks. https://docs.docker.com/engine/api/v1.41/#operation/NetworkPrune POST "/networks/prune"

func Ping

func Ping(cr *common.ContextRouter, c *gin.Context)

Ping - dummy endpoint you can use to test if the server is accessible. https://docs.docker.com/engine/api/v1.41/#operation/SystemPing HEAD "/_ping" GET "/_ping"

func Version

func Version(cr *common.ContextRouter, c *gin.Context)

Version - get version. https://docs.docker.com/engine/api/v1.41/#operation/SystemVersion GET "/version"

func VolumesPrune

func VolumesPrune(cr *common.ContextRouter, c *gin.Context)

VolumesPrune - Delete unused volumes. https://docs.docker.com/engine/api/v1.41/#operation/VolumePrune POST "/volumes/prune"

Types

type ContainerCreateRequest

type ContainerCreateRequest struct {
	Name          string                 `json:"name"`
	Image         string                 `json:"image"`
	ExposedPorts  map[string]interface{} `json:"ExposedPorts"`
	Labels        map[string]string      `json:"Labels"`
	Entrypoint    []string               `json:"Entrypoint"`
	Cmd           []string               `json:"Cmd"`
	Env           []string               `json:"Env"`
	User          string                 `json:"User"`
	HostConfig    HostConfig             `json:"HostConfig"`
	NetworkConfig NetworkingConfig       `json:"NetworkingConfig"`
}

ContainerCreateRequest represents the json structure that is used for the /container/create post endpoint.

type EndpointConfig

type EndpointConfig struct {
	Aliases   []string `json:"Aliases"`
	NetworkID string   `json:"NetworkID"`
}

EndpointConfig contains information about network endpoints

type HostConfig

type HostConfig struct {
	Binds        []string `json:"Binds"`
	Mounts       []Mount  `json:"Mounts"`
	PortBindings map[string][]PortBinding
	Memory       int `json:"Memory"`
	NanoCpus     int `json:"NanoCpus"`
}

HostConfig contains to be mounted files from the host system.

type Mount

type Mount struct {
	Type     string `json:"Type"`
	Source   string `json:"Source"`
	Target   string `json:"Target"`
	ReadOnly bool   `json:"ReadOnly"`
}

Mount contains information about mounted volumes/bindings

type NetworkConfig

type NetworkConfig struct {
	EndpointConfig EndpointConfig `json:"EndpointConfig"`
}

NetworkConfig contains network configuration

type NetworkConnectRequest

type NetworkConnectRequest struct {
	Container      string         `json:"container"`
	EndpointConfig EndpointConfig `json:"EndpointConfig"`
}

NetworkConnectRequest represents the json structure that is used for the /networks/:id/connect post endpoint.

type NetworkCreateRequest

type NetworkCreateRequest struct {
	Name   string            `json:"Name"`
	Labels map[string]string `json:"Labels"`
}

NetworkCreateRequest represents the json structure that is used for the /networks/create post endpoint.

type NetworkDisconnectRequest

type NetworkDisconnectRequest struct {
	Container string `json:"container"`
}

NetworkDisconnectRequest represents the json structure that is used for the /networks/:id/disconnect post endpoint.

type NetworkingConfig

type NetworkingConfig struct {
	EndpointsConfig map[string]EndpointConfig `json:"EndpointsConfig"`
}

NetworkingConfig contains network configuration

type PortBinding

type PortBinding struct {
	HostPort string `json:"HostPort"`
}

PortBinding represents a binding between to a port

Jump to

Keyboard shortcuts

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