dockerMiddleware

package
v0.0.0-...-f72604a Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2018 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const GlobalTimeoutSeconds = 60

GlobalTimeoutSeconds specify the predefined timeout for the orchestration processes

Variables

This section is empty.

Functions

func AddMount

func AddMount(slice []mount.Mount, mount mount.Mount) []mount.Mount

AddMount Add the given Mount to Slice

func AttachNetworkMap

func AttachNetworkMap(alias string, networkID string) *swarm.NetworkAttachmentConfig

AttachNetworkMap creates a networkAttachmentConfig with the existing specified network

func ComposeService

func ComposeService(serviceImage *atqTypes.ServiceImage, globalAlias, alias string, path *string, mode *swarm.ServiceMode, networkID *string) (*types.ServiceCreateResponse, error)

ComposeService Maps the values to a new service

func ContainerSpecMapper

func ContainerSpecMapper(serviceImage *atqTypes.ServiceImage, alias string, mounts []mount.Mount) *swarm.ContainerSpec

ContainerSpecMapper initializes a new Docker ContainerSpec type with the predefined serviceImage

func CreateMounts

func CreateMounts(path *string, alias string) []mount.Mount

CreateMounts configures the mounts given an alias and a path

func CreateNetworkMap

func CreateNetworkMap(alias string) (*swarm.NetworkAttachmentConfig, error)

CreateNetworkMap creates a new specific network for the service

func CreateOverlayNetwork

func CreateOverlayNetwork(id string) (types.NetworkCreateResponse, error)

CreateOverlayNetwork creates a new Overlay Network in the Swarm

func CreateService

func CreateService(serviceSpec swarm.ServiceSpec) (types.ServiceCreateResponse, error)

CreateService creates a new service in the cluster with the given parameters

func CreateVolumeWithData

func CreateVolumeWithData(alias, path string) (types.Volume, error)

CreateVolumeWithData declares a new volume mapped to a given directory

func InitDiscoverer

func InitDiscoverer(globalAlias string) (*app.AtqService, error)

InitDiscoverer deploys dnsrr-discovery API into the Swarm

func InitService

func InitService(serviceType string, globalAlias string, service *app.ServicePayload, networkID *string, persistance *persistance.Persistance) (*app.AtqService, error)

InitService initializes the service

func IsSwarmNode

func IsSwarmNode() bool

IsSwarmNode returns an error if the node is not a swarm node member

func NetworkContainers

func NetworkContainers(networkID string) (*map[string]types.EndpointResource, error)

NetworkContainers returns a list containing all Containers using the network and its Virtual IP

func NetworkVIPs

func NetworkVIPs(networkID string) (*[]string, error)

NetworkVIPs returns the string list containing all Virtual IPs of a given Network

func RemoveNetwork

func RemoveNetwork(id string) error

RemoveNetwork removes specified network from the cluster

func RemoveService

func RemoveService(serviceID string) error

RemoveService deletes the service specified

func RemoveVolume

func RemoveVolume(volumeID string, force bool) error

RemoveVolume removes a given Volume

func ServiceAttachedNetworkID

func ServiceAttachedNetworkID(serviceID string) (*string, error)

ServiceAttachedNetworkID finds the network attached to a Service and return its attached netwrok

func ServiceDetails

func ServiceDetails(serviceID string) (*swarm.Service, error)

ServiceDetails return the Service details

func ServiceHostWaiter

func ServiceHostWaiter(serviceID string, replicas int, timeout int) error

ServiceHostWaiter await for a given amount of VIPS specified in the parameter. Timeout in seconds Only for service deployed on the current host

func ServiceModeDefault

func ServiceModeDefault() *swarm.ServiceMode

ServiceModeDefault returns a Replicated Service Mode with 1 replica by default

func ServiceVIPS

func ServiceVIPS(serviceID string) (*[]swarm.EndpointVirtualIP, error)

ServiceVIPS return the list of containers Virtual IPs of the given Service

func SwarmInspect

func SwarmInspect() (swarm.Swarm, error)

SwarmInspect gives the information about the Swarm

func TaskMasterWorker

func TaskMasterWorker(task *app.TaskPayload, persistance *persistance.Persistance) (*app.AtqTaskFull, error)

TaskMasterWorker initializes a new Master/Worker Task Type

func TaskSpecMapper

func TaskSpecMapper(containerSpec *swarm.ContainerSpec, networkAttachConfig []swarm.NetworkAttachmentConfig, placement *swarm.Placement) *swarm.TaskSpec

TaskSpecMapper maps the service configuration

func VIPSWaiter

func VIPSWaiter(globalAlias, serviceName string, replicas int, timeout int, service Service, host string) error

VIPSWaiter await for a given amount of VIPS specified in the parameter. Timeout in seconds

func WorkerHealthchecks

func WorkerHealthchecks(containerID string, replicas int, timeoutSeconds int) error

WorkerHealthchecks runs the given healthchecks in a Service to ensure all worker containers are ready for use

Types

type Service

type Service int

Service holds the different types available

const (
	Worker     Service = 0
	Master     Service = 1
	Discoverer Service = 3
)

func (Service) Name

func (service Service) Name() string

Returns the Service Type Name

Jump to

Keyboard shortcuts

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