Documentation ¶
Index ¶
- Variables
- func AddLabels(containerConfig types.ContainerJSON, labels map[string]string) error
- func AttachNetwork(w http.ResponseWriter, req *http.Request)
- func AttachNetworkToCosmos(newNeworkName string) error
- func AutoUpdateContainerRoute(w http.ResponseWriter, req *http.Request)
- func BootstrapAllContainersFromTags() []error
- func BootstrapContainerFromTags(containerID string) error
- func CanUpdateImageRoute(w http.ResponseWriter, req *http.Request)
- func CheckPorts() error
- func CheckUpdatesAvailable() map[string]bool
- func Connect() error
- func ConnectToNetworkIfNotConnected(containerConfig types.ContainerJSON, networkName string) error
- func ConnectToNetworkSync(networkName string, containerID string) error
- func ConnectToSecureNetwork(containerConfig types.ContainerJSON) (bool, error)
- func ContainersIdRoute(w http.ResponseWriter, req *http.Request)
- func ContainersRoute(w http.ResponseWriter, req *http.Request)
- func CreateCosmosNetwork() (string, error)
- func CreateLinkNetwork(containerName string, container2Name string) error
- func CreateNetworkRoute(w http.ResponseWriter, req *http.Request)
- func CreateService(serviceRequest DockerServiceCreateRequest, OnLog func(string)) error
- func CreateServiceRoute(w http.ResponseWriter, req *http.Request)
- func CreateVolumeRoute(w http.ResponseWriter, req *http.Request)
- func DebouncedExportDocker()
- func DeleteNetworkRoute(w http.ResponseWriter, req *http.Request)
- func DeleteVolumeRoute(w http.ResponseWriter, req *http.Request)
- func DetachNetwork(w http.ResponseWriter, req *http.Request)
- func DockerListenEvents() error
- func DockerPullImage(image string) (io.ReadCloser, error)
- func EditContainer(oldContainerID string, newConfig types.ContainerJSON, noLock bool) (string, error)
- func ExportDocker()
- func GetAllPorts(container types.ContainerJSON) []string
- func GetContainerIPByName(containerName string) (ip string, err error)
- func GetContainerLogsRoute(w http.ResponseWriter, req *http.Request)
- func GetContainerRoute(w http.ResponseWriter, req *http.Request)
- func GetLabel(containerConfig types.ContainerJSON, label string) string
- func HasAutoUpdateOn(containerConfig types.ContainerJSON) bool
- func HasLabel(containerConfig types.ContainerJSON, label string) bool
- func InspectImageRoute(w http.ResponseWriter, req *http.Request)
- func IsConnectedToASecureCosmosNetwork(self types.ContainerJSON, containerConfig types.ContainerJSON) (bool, error, bool)
- func IsConnectedToNetwork(containerConfig types.ContainerJSON, networkName string) bool
- func IsLabel(containerConfig types.ContainerJSON, label string) bool
- func ListContainerNetworks(w http.ResponseWriter, req *http.Request)
- func ListContainers() ([]types.Container, error)
- func ListContainersRoute(w http.ResponseWriter, req *http.Request)
- func ListNetworksRoute(w http.ResponseWriter, req *http.Request)
- func ListVolumeRoute(w http.ResponseWriter, req *http.Request)
- func ManageContainerRoute(w http.ResponseWriter, req *http.Request)
- func NetworkCleanUp()
- func NetworkContainerRoutes(w http.ResponseWriter, req *http.Request)
- func NetworkRoutes(w http.ResponseWriter, req *http.Request)
- func NewDB(w http.ResponseWriter, req *http.Request) (string, error)
- func NewDBRoute(w http.ResponseWriter, req *http.Request)
- func PullImage(w http.ResponseWriter, req *http.Request)
- func PullImageIfMissing(w http.ResponseWriter, req *http.Request)
- func RecreateContainer(containerID string, containerConfig types.ContainerJSON) (string, error)
- func RecreateDepedencies(containerID string)
- func RemoveLabels(containerConfig types.ContainerJSON, labels []string) error
- func RemoveSelfUpdater() error
- func Rollback(actions []DockerServiceCreateRollback, OnLog func(string))
- func RunContainer(imagename string, containername string, inputEnv []string, ...) error
- func SecureContainerRoute(w http.ResponseWriter, req *http.Request)
- func SelfRecreate() error
- func TerminalRoute(w http.ResponseWriter, r *http.Request)
- func Test() error
- func UnexposeAllPorts(container *types.ContainerJSON) error
- func UnsecureContainer(container types.ContainerJSON) (string, error)
- func UpdateContainerRoute(w http.ResponseWriter, req *http.Request)
- func UpdatePorts(finalPorts []string) error
- func VolumesRoute(w http.ResponseWriter, req *http.Request)
- type Cache
- type ContainerCreateRequestContainer
- type ContainerCreateRequestContainerHealthcheck
- type ContainerCreateRequestNetwork
- type ContainerCreateRequestNetworkIPAMConfig
- type ContainerCreateRequestServiceNetwork
- type ContainerCreateRequestVolume
- type ContainerForm
- type ContainerStats
- type DockerServiceCreateRequest
- type DockerServiceCreateRollback
- type LogOutput
- type VolumeCreateRequest
- type VolumeMount
Constants ¶
This section is empty.
Variables ¶
View Source
var DebouncedNetworkCleanUp = _debounceNetworkCleanUp()
View Source
var DockerClient *client.Client
View Source
var DockerContext context.Context
View Source
var DockerIsConnected = false
View Source
var DockerNetworkLock = make(chan bool, 1)
use a semaphore lock
View Source
var DockerNetworkName = "cosmos-network"
View Source
var ExportError = ""
Functions ¶
func AddLabels ¶
func AddLabels(containerConfig types.ContainerJSON, labels map[string]string) error
func AttachNetwork ¶
func AttachNetwork(w http.ResponseWriter, req *http.Request)
func AttachNetworkToCosmos ¶
func AutoUpdateContainerRoute ¶
func AutoUpdateContainerRoute(w http.ResponseWriter, req *http.Request)
func BootstrapAllContainersFromTags ¶
func BootstrapAllContainersFromTags() []error
func CanUpdateImageRoute ¶
func CanUpdateImageRoute(w http.ResponseWriter, req *http.Request)
func CheckPorts ¶
func CheckPorts() error
func CheckUpdatesAvailable ¶
func ConnectToNetworkIfNotConnected ¶
func ConnectToNetworkIfNotConnected(containerConfig types.ContainerJSON, networkName string) error
func ConnectToNetworkSync ¶
func ConnectToSecureNetwork ¶
func ConnectToSecureNetwork(containerConfig types.ContainerJSON) (bool, error)
func ContainersIdRoute ¶
func ContainersIdRoute(w http.ResponseWriter, req *http.Request)
func ContainersRoute ¶
func ContainersRoute(w http.ResponseWriter, req *http.Request)
func CreateCosmosNetwork ¶
func CreateLinkNetwork ¶
func CreateNetworkRoute ¶
func CreateNetworkRoute(w http.ResponseWriter, req *http.Request)
func CreateService ¶
func CreateService(serviceRequest DockerServiceCreateRequest, OnLog func(string)) error
func CreateServiceRoute ¶
func CreateServiceRoute(w http.ResponseWriter, req *http.Request)
func CreateVolumeRoute ¶
func CreateVolumeRoute(w http.ResponseWriter, req *http.Request)
func DebouncedExportDocker ¶ added in v0.11.0
func DebouncedExportDocker()
func DeleteNetworkRoute ¶
func DeleteNetworkRoute(w http.ResponseWriter, req *http.Request)
func DeleteVolumeRoute ¶
func DeleteVolumeRoute(w http.ResponseWriter, req *http.Request)
func DetachNetwork ¶
func DetachNetwork(w http.ResponseWriter, req *http.Request)
func DockerListenEvents ¶
func DockerListenEvents() error
func DockerPullImage ¶ added in v0.9.12
func DockerPullImage(image string) (io.ReadCloser, error)
func EditContainer ¶
func ExportDocker ¶ added in v0.11.0
func ExportDocker()
func GetAllPorts ¶
func GetAllPorts(container types.ContainerJSON) []string
func GetContainerIPByName ¶ added in v0.12.0
func GetContainerLogsRoute ¶
func GetContainerLogsRoute(w http.ResponseWriter, req *http.Request)
func GetContainerRoute ¶
func GetContainerRoute(w http.ResponseWriter, req *http.Request)
func HasAutoUpdateOn ¶
func HasAutoUpdateOn(containerConfig types.ContainerJSON) bool
func InspectImageRoute ¶
func InspectImageRoute(w http.ResponseWriter, req *http.Request)
func IsConnectedToASecureCosmosNetwork ¶
func IsConnectedToASecureCosmosNetwork(self types.ContainerJSON, containerConfig types.ContainerJSON) (bool, error, bool)
func IsConnectedToNetwork ¶
func IsConnectedToNetwork(containerConfig types.ContainerJSON, networkName string) bool
func ListContainerNetworks ¶
func ListContainerNetworks(w http.ResponseWriter, req *http.Request)
func ListContainers ¶
func ListContainersRoute ¶
func ListContainersRoute(w http.ResponseWriter, req *http.Request)
func ListNetworksRoute ¶
func ListNetworksRoute(w http.ResponseWriter, req *http.Request)
func ListVolumeRoute ¶
func ListVolumeRoute(w http.ResponseWriter, req *http.Request)
func ManageContainerRoute ¶
func ManageContainerRoute(w http.ResponseWriter, req *http.Request)
func NetworkCleanUp ¶
func NetworkCleanUp()
func NetworkContainerRoutes ¶
func NetworkContainerRoutes(w http.ResponseWriter, req *http.Request)
func NetworkRoutes ¶
func NetworkRoutes(w http.ResponseWriter, req *http.Request)
func NewDBRoute ¶
func NewDBRoute(w http.ResponseWriter, req *http.Request)
func PullImageIfMissing ¶
func PullImageIfMissing(w http.ResponseWriter, req *http.Request)
func RecreateContainer ¶
func RecreateContainer(containerID string, containerConfig types.ContainerJSON) (string, error)
func RecreateDepedencies ¶
func RecreateDepedencies(containerID string)
func RemoveLabels ¶
func RemoveLabels(containerConfig types.ContainerJSON, labels []string) error
func RemoveSelfUpdater ¶
func RemoveSelfUpdater() error
func Rollback ¶
func Rollback(actions []DockerServiceCreateRollback, OnLog func(string))
func RunContainer ¶
func RunContainer(imagename string, containername string, inputEnv []string, volumes []VolumeMount) error
func SecureContainerRoute ¶
func SecureContainerRoute(w http.ResponseWriter, req *http.Request)
func SelfRecreate ¶
func SelfRecreate() error
func TerminalRoute ¶
func TerminalRoute(w http.ResponseWriter, r *http.Request)
func UnexposeAllPorts ¶
func UnexposeAllPorts(container *types.ContainerJSON) error
func UnsecureContainer ¶
func UnsecureContainer(container types.ContainerJSON) (string, error)
func UpdateContainerRoute ¶
func UpdateContainerRoute(w http.ResponseWriter, req *http.Request)
func UpdatePorts ¶
func VolumesRoute ¶
func VolumesRoute(w http.ResponseWriter, req *http.Request)
Types ¶
type ContainerCreateRequestContainer ¶
type ContainerCreateRequestContainer struct { Name string `json:"container_name"` Image string `json:"image"` Environment []string `json:"environment"` Labels map[string]string `json:"labels"` Ports []string `json:"ports"` Volumes []mount.Mount `json:"volumes"` Networks map[string]ContainerCreateRequestServiceNetwork `json:"networks"` Routes []utils.ProxyRouteConfig `json:"routes"` Links []string `json:"links,omitempty"` RestartPolicy string `json:"restart,omitempty"` Devices []string `json:"devices"` Expose []string `json:"expose"` DependsOn []string `json:"depends_on"` Tty bool `json:"tty,omitempty"` StdinOpen bool `json:"stdin_open,omitempty"` Command string `json:"command,omitempty"` Entrypoint string `json:"entrypoint,omitempty"` WorkingDir string `json:"working_dir,omitempty"` User string `json:"user,omitempty"` UID int `json:"uid,omitempty"` GID int `json:"gid,omitempty"` Hostname string `json:"hostname,omitempty"` Domainname string `json:"domainname,omitempty"` MacAddress string `json:"mac_address,omitempty"` Privileged bool `json:"privileged,omitempty"` NetworkMode string `json:"network_mode,omitempty"` StopSignal string `json:"stop_signal,omitempty"` StopGracePeriod int `json:"stop_grace_period,omitempty"` HealthCheck ContainerCreateRequestContainerHealthcheck `json:"healthcheck,omitempty"` DNS []string `json:"dns,omitempty"` DNSSearch []string `json:"dns_search,omitempty"` ExtraHosts []string `json:"extra_hosts,omitempty"` SecurityOpt []string `json:"security_opt,omitempty"` StorageOpt map[string]string `json:"storage_opt,omitempty"` Sysctls map[string]string `json:"sysctls,omitempty"` Isolation string `json:"isolation,omitempty"` CapAdd []string `json:"cap_add,omitempty"` CapDrop []string `json:"cap_drop,omitempty"` SysctlsMap map[string]string `json:"sysctls,omitempty"` PostInstall []string `json:"post_install,omitempty"` }
func ReOrderServices ¶
func ReOrderServices(serviceMap map[string]ContainerCreateRequestContainer) ([]ContainerCreateRequestContainer, error)
type ContainerCreateRequestContainerHealthcheck ¶ added in v0.11.0
type ContainerCreateRequestNetwork ¶
type ContainerCreateRequestNetwork struct { // name must be unique Name string `json:"name"` Driver string `json:"driver"` Attachable bool `json:"attachable"` Internal bool `json:"internal"` EnableIPv6 bool `json:"enable_ipv6"` Labels map[string]string `json:"labels"` IPAM struct { Driver string `json:"driver"` Config []ContainerCreateRequestNetworkIPAMConfig `json:"config"` } `json:"ipam"` }
type ContainerCreateRequestNetworkIPAMConfig ¶ added in v0.11.0
type ContainerForm ¶
type ContainerForm struct { Image string `json:"image"` RestartPolicy string `json:"restartPolicy"` Env []string `json:"envVars"` Labels map[string]string `json:"labels"` PortBindings nat.PortMap `json:"portBindings"` Volumes []mount.Mount `json:"Volumes"` // we make this a int so that we can ignore 0 Interactive int `json:"interactive"` NetworkMode string `json:"networkMode"` }
type ContainerStats ¶ added in v0.12.0
type ContainerStats struct { Name string CPUUsage float64 MemUsage uint64 MemLimit uint64 NetworkRx uint64 NetworkTx uint64 }
func StatsAll ¶ added in v0.12.0
func StatsAll() ([]ContainerStats, error)
type DockerServiceCreateRequest ¶
type DockerServiceCreateRequest struct { Services map[string]ContainerCreateRequestContainer `json:"services"` Volumes map[string]ContainerCreateRequestVolume `json:"volumes"` Networks map[string]ContainerCreateRequestNetwork `json:"networks"` }
type DockerServiceCreateRollback ¶
type DockerServiceCreateRollback struct { // action: disconnect, remove, etc... Action string `json:"action"` // type: container, volume, network Type string `json:"type"` // name: container name, volume name, network name Name string `json:"name"` // was: container old settings Was doctype.ContainerJSON `json:"was"` }
type LogOutput ¶
type LogOutput struct { StreamType byte `json:"streamType"` Size uint32 `json:"size"` Output string `json:"output"` }
func ParseDockerLogHeader ¶
ParseDockerLogHeader parses the first 8 bytes of a Docker log message and returns the stream type, size, and the rest of the message as output. It also checks if the message contains a log header and extracts the log message from it.
type VolumeCreateRequest ¶
type VolumeMount ¶
Source Files ¶
- api.go
- api_autoupdate.go
- api_blueprint.go
- api_getcontainers.go
- api_getlogs.go
- api_images.go
- api_listcontainers.go
- api_managecont.go
- api_networks.go
- api_newDB.go
- api_secureContainer.go
- api_terminal.go
- api_update.go
- api_updateContainer.go
- api_volumes.go
- bootstrap.go
- checkPorts.go
- docker.go
- events.go
- export.go
- ip.go
- network.go
- run.go
Click to show internal directories.
Click to hide internal directories.