Versions in this module Expand all Collapse all v1 v1.0.6 Oct 31, 2016 Changes in this version + func EncodeRegistryAuth(authInfo *rauth.RegistryAuth) (string, error) v1.0.5 Sep 28, 2016 Changes in this version + const CodeConnToNodeError + const CodeContainerAlreadyRunning + const CodeContainerInvalid + const CodeContainerNotRunning + const CodeErrorNodeAvailability + const CodeErrorNodeRole + const CodeErrorUpdateNodeMethod + const CodeGetManagerInfoError + const CodeGetNodeAdvertiseAddrError + const CodeGetNodeEndpointError + const CodeGetNodeInfoError + const CodeGetServicePortConflictError + const CodeInvalidImageName + const CodeInvalidNetworkName + const CodeInvalidServiceDelay + const CodeInvalidServiceEndpoint + const CodeInvalidServiceMemoryBytes + const CodeInvalidServiceName + const CodeInvalidServiceNanoCPUs + const CodeInvalidServicePlacement + const CodeInvalidServiceSpec + const CodeInvalidServiceUpdateConfig + const CodeInvalidServiceWindow + const CodeInvalidStackName + const CodeInvalidVolumeName + const CodeJoinNodeError + const CodeNetworkInvalid + const CodeNetworkOrContainerInvalid + const CodeNetworkPredefined + const CodeNodeEndpointIpMatchError + const CodePatchContainerMethodUndefined + const CodePatchContainerParamError + const CodeStackUnavailable + const CodeVerifyNodeEnpointFailed + const LabelRegistryAuth + const SseTypeContainerLogs + const SseTypeContainerStats + const SseTypeServiceLogs + const SseTypeServiceStats + const TaskRunningState + var ErrPermissionNotExists = errors.New("permission not exists") + func CalcNetworkRate(stats [2]*docker.Stats) (rRate, sRate uint64) + func EncodedRegistryAuth(registryAuth string) (string, error) + func GetServicesNamespace(spec swarm.ServiceSpec) string + func NewGoDockerClientTls(endpoint string, config *config.Config) (*docker.Client, error) + func NewHttpClient() (*httpclient.Client, error) + func NewHttpClientTls(config *config.Config) (*httpclient.Client, error) + func PortConflictToString(pc swarm.PortConfig) string + func SharedClientCertFiles(config *config.Config) (string, string, string) + func ToCraneError(err error) error + func ValidateCraneServiceSpec(spec *model.CraneServiceSpec) error + type CraneDockerClient struct + func NewCraneDockerClient(config *config.Config) (*CraneDockerClient, error) + func (client *CraneDockerClient) CheckServicePortConflicts(spec *model.CraneServiceSpec, serviceId string) error + func (client *CraneDockerClient) ConnectNetwork(id string, opts docker.NetworkConnectionOptions) error + func (client *CraneDockerClient) ConnectNodeNetwork(ctx context.Context, networkID string, opts docker.NetworkConnectionOptions) error + func (client *CraneDockerClient) CreateNetwork(opts docker.CreateNetworkOptions) (*docker.Network, error) + func (client *CraneDockerClient) CreateNode(joiningNode model.JoiningNode) error + func (client *CraneDockerClient) CreateNodeNetwork(ctx context.Context, opts docker.CreateNetworkOptions) (*docker.Network, error) + func (client *CraneDockerClient) CreateService(service swarm.ServiceSpec, options types.ServiceCreateOptions) (types.ServiceCreateResponse, error) + func (client *CraneDockerClient) CreateVolume(ctx context.Context, opts docker.CreateVolumeOptions) (*docker.Volume, error) + func (client *CraneDockerClient) DeployStack(bundle *model.Bundle) error + func (client *CraneDockerClient) DiffContainer(ctx context.Context, containerID string) ([]docker.Change, error) + func (client *CraneDockerClient) DisconnectNetwork(id string, opts docker.NetworkConnectionOptions) error + func (client *CraneDockerClient) DisconnectNodeNetwork(ctx context.Context, networkID string, opts docker.NetworkConnectionOptions) error + func (client *CraneDockerClient) FilterServiceByStack(namespace string, opts types.ServiceListOptions) ([]swarm.Service, error) + func (client *CraneDockerClient) GetDaemonUrlById(nodeId string) (*url.URL, error) + func (client *CraneDockerClient) GetServiceNetworkNames(networkAttachmentConfigs []swarm.NetworkAttachmentConfig) []string + func (client *CraneDockerClient) GetServicesStatus(services []swarm.Service) ([]ServiceStatus, error) + func (client *CraneDockerClient) GetStackGroup(namespace string) (uint64, error) + func (client *CraneDockerClient) ImageHistory(ctx context.Context, imageID string) ([]docker.ImageHistory, error) + func (client *CraneDockerClient) Info(ctx context.Context) (*docker.DockerInfo, error) + func (client *CraneDockerClient) InspectContainer(ctx context.Context, id string) (*docker.Container, error) + func (client *CraneDockerClient) InspectImage(ctx context.Context, imageID string) (*docker.Image, error) + func (client *CraneDockerClient) InspectNetwork(id string) (*docker.Network, error) + func (client *CraneDockerClient) InspectNode(nodeId string) (swarm.Node, error) + func (client *CraneDockerClient) InspectNodeNetwork(ctx context.Context, networkID string) (*docker.Network, error) + func (client *CraneDockerClient) InspectServiceWithRaw(serviceID string) (swarm.Service, error) + func (client *CraneDockerClient) InspectStack(namespace string) (*model.Bundle, error) + func (client *CraneDockerClient) InspectSwarm() (swarm.Swarm, error) + func (client *CraneDockerClient) InspectTask(taskID string) (*swarm.Task, error) + func (client *CraneDockerClient) InspectVolume(ctx context.Context, name string) (*docker.Volume, error) + func (client *CraneDockerClient) KillContainer(ctx context.Context, opts docker.KillContainerOptions) error + func (client *CraneDockerClient) ListContainers(ctx context.Context, opts docker.ListContainersOptions) ([]docker.APIContainers, error) + func (client *CraneDockerClient) ListImages(ctx context.Context, opts docker.ListImagesOptions) ([]docker.APIImages, error) + func (client *CraneDockerClient) ListNetworks(opts docker.NetworkFilterOpts) ([]docker.Network, error) + func (client *CraneDockerClient) ListNode(opts types.NodeListOptions) ([]swarm.Node, error) + func (client *CraneDockerClient) ListNodeNetworks(ctx context.Context, opts docker.NetworkFilterOpts) ([]docker.Network, error) + func (client *CraneDockerClient) ListService(options types.ServiceListOptions) ([]ServiceStatus, error) + func (client *CraneDockerClient) ListServiceSpec(options types.ServiceListOptions) ([]swarm.Service, error) + func (client *CraneDockerClient) ListStack() (Stacks, error) + func (client *CraneDockerClient) ListStackService(namespace string, opts types.ServiceListOptions) ([]ServiceStatus, error) + func (client *CraneDockerClient) ListTasks(options types.TaskListOptions) (Tasks, error) + func (client *CraneDockerClient) ListVolumes(ctx context.Context, opts docker.ListVolumesOptions) ([]docker.Volume, error) + func (client *CraneDockerClient) LogsContainer(ctx context.Context, containerId string, message chan string) + func (client *CraneDockerClient) ManagerInfo() (types.Info, error) + func (client *CraneDockerClient) PauseContainer(ctx context.Context, containerID string) error + func (client *CraneDockerClient) Ping() error + func (client *CraneDockerClient) PretreatmentStack(bundle model.Bundle) (map[string]bool, error) + func (client *CraneDockerClient) RemoveContainer(ctx context.Context, opts docker.RemoveContainerOptions) error + func (client *CraneDockerClient) RemoveImage(ctx context.Context, imageID string) error + func (client *CraneDockerClient) RemoveNetwork(id string) error + func (client *CraneDockerClient) RemoveNode(nodeId string) error + func (client *CraneDockerClient) RemoveService(serviceID string) error + func (client *CraneDockerClient) RemoveStack(namespace string) error + func (client *CraneDockerClient) RemoveVolume(ctx context.Context, name string) error + func (client *CraneDockerClient) RenameContainer(ctx context.Context, opts docker.RenameContainerOptions) error + func (client *CraneDockerClient) ResizeContainerTTY(ctx context.Context, containerID string, height, width int) error + func (client *CraneDockerClient) RestartContainer(ctx context.Context, containerId string, timeout uint) error + func (client *CraneDockerClient) ScaleService(serviceID string, serviceScale ServiceScale) error + func (client *CraneDockerClient) ServiceAddLabel(serviceID string, labels map[string]string) error + func (client *CraneDockerClient) ServiceRemoveLabel(serviceID string, labels []string) error + func (client *CraneDockerClient) StartContainer(ctx context.Context, containerID string, hostconfig *docker.HostConfig) error + func (client *CraneDockerClient) StatsContainer(ctx context.Context, opts model.ContainerStatOptions) error + func (client *CraneDockerClient) StopContainer(ctx context.Context, containerId string, timeout uint) error + func (client *CraneDockerClient) SwarmManager() *docker.Client + func (client *CraneDockerClient) SwarmNode(ctx context.Context) (*docker.Client, error) + func (client *CraneDockerClient) ToCraneServiceSpec(swarmService swarm.ServiceSpec) model.CraneServiceSpec + func (client *CraneDockerClient) UnpauseContainer(ctx context.Context, containerID string) error + func (client *CraneDockerClient) UpdateNode(nodeId string, opts model.UpdateOptions) error + func (client *CraneDockerClient) UpdateService(serviceID string, version swarm.Version, service swarm.ServiceSpec, ...) error + func (client *CraneDockerClient) UpdateServiceAutoOption(serviceID string, version swarm.Version, service swarm.ServiceSpec) error + func (client *CraneDockerClient) VerifyNodeEndpoint(nodeId string, nodeUrl *url.URL) error + type DockerClientInterface interface + ConnectNetwork func(id string, opts docker.NetworkConnectionOptions) error + ConnectNodeNetwork func(ctx context.Context, networkID string, opts docker.NetworkConnectionOptions) error + CreateNetwork func(opts docker.CreateNetworkOptions) (*docker.Network, error) + CreateNode func(joiningNode node.JoiningNode) error + CreateNodeNetwork func(ctx context.Context, opts docker.CreateNetworkOptions) (*docker.Network, error) + CreateService func(service swarm.ServiceSpec, options types.ServiceCreateOptions) (types.ServiceCreateResponse, error) + CreateVolume func(nodeId string, opts docker.CreateVolumeOptions) (*docker.Volume, error) + DeployStack func(bundle *model.Bundle) error + DisconnectNetwork func(id string, opts docker.NetworkConnectionOptions) error + DisconnectNodeNetwork func(ctx context.Context, networkID string, opts docker.NetworkConnectionOptions) error + FilterServiceByStack func(namespace string, opts types.ServiceListOptions) ([]swarm.Service, error) + GetDaemonUrlById func(nodeId string) (*url.URL, error) + GetServiceNetworkNames func(networkAttachmentConfigs []swarm.NetworkAttachmentConfig) []string + GetServicesStatus func(services []swarm.Service) ([]ServiceStatus, error) + GetStackGroup func(namespace string) (uint64, error) + ImageHistory func(nodeId, imageId string) ([]docker.ImageHistory, error) + Info func(nodeId string) (types.Info, error) + InspectContainer func(id string) (*docker.Container, error) + InspectImage func(nodeId, imageId string) (*docker.Image, error) + InspectNetwork func(id string) (*docker.Network, error) + InspectNode func(nodeId string) (swarm.Node, error) + InspectNodeNetwork func(ctx context.Context, networkID string) (*docker.Network, error) + InspectServiceWithRaw func(serviceID string) (swarm.Service, error) + InspectStack func(namespace string) (*model.Bundle, error) + InspectSwarm func() (swarm.Swarm, error) + InspectVolume func(nodeId, name string) (*docker.Volume, error) + ListContainers func(opts docker.ListContainersOptions) ([]docker.APIContainers, error) + ListImages func(nodeId string, opts docker.ListImagesOptions) ([]docker.APIImages, error) + ListNetworks func(opts docker.NetworkFilterOpts) ([]docker.Network, error) + ListNode func(opts types.NodeListOptions) ([]swarm.Node, error) + ListNodeNetworks func(ctx context.Context, opts docker.NetworkFilterOpts) ([]docker.Network, error) + ListService func(options types.ServiceListOptions) ([]ServiceStatus, error) + ListServiceSpec func(options types.ServiceListOptions) ([]swarm.Service, error) + ListStack func() ([]Stack, error) + ListStackService func(namespace string, opts types.ServiceListOptions) ([]ServiceStatus, error) + ListVolumes func(nodeId string, opts docker.ListVolumesOptions) ([]docker.Volume, error) + LogsContainer func(nodeId, containerId string, message chan string) + ManagerInfo func() (types.Info, error) + Ping func() error + RemoveContainer func(opts docker.RemoveContainerOptions) error + RemoveNetwork func(id string) error + RemoveNode func(nodeId string) error + RemoveService func(serviceID string) error + RemoveStack func(namespace string) error + RemoveVolume func(nodeId string, name string) error + ScaleService func(serviceID string, serviceScale ServiceScale) error + ServiceAddLabel func(serviceID string, labels map[string]string) error + ServiceRemoveLabel func(serviceID string, labels []string) error + StatsContainer func(nodeId, containerId string, stats chan *model.CraneContainerStat) + ToCraneServiceSpec func(swarmService swarm.ServiceSpec) model.CraneServiceSpec + UpdateNode func(nodeId string, opts node.UpdateOptions) error + UpdateService func(serviceID string, version swarm.Version, service swarm.ServiceSpec, ...) error + type ServiceScale struct + NumTasks uint64 + type ServiceStatus struct + Command string + CreatedAt time.Time + ID string + IPs []string + Image string + LimitCpus int64 + LimitMems int64 + Name string + NumTasksRunning int + NumTasksTotal int + Ports []uint32 + ReserveCpus int64 + ReserveMems int64 + UpdatedAt time.Time + type Stack struct + Namespace string + ServiceCount int + Services []ServiceStatus + type Stacks []Stack + func (s Stacks) Len() int + func (s Stacks) Less(i, j int) bool + func (s Stacks) Swap(i, j int) + type Tasks []swarm.Task + func (t Tasks) Len() int + func (t Tasks) Less(i, j int) bool + func (t Tasks) Swap(i, j int)