forked from helmutkemper/iotmaker.docker.builder
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfuncContainerFindIdByNameContains.go
More file actions
54 lines (48 loc) · 1.12 KB
/
Copy pathfuncContainerFindIdByNameContains.go
File metadata and controls
54 lines (48 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
package iotmakerdockerbuilder
import (
iotmakerdocker "github.com/helmutkemper/iotmaker.docker/v1.0.1"
)
// ContainerFindIdByNameContains
//
// Similar:
//
// ContainerFindIdByName(), ContainerFindIdByNameContains()
//
// English:
//
// Searches and returns the ID list of the container name
//
// Input:
// name: name of the container.
//
// Output:
// id: list of containers ID
// err: standard error object
//
// Português:
//
// Procura e retorna uma lista de IDs de containers
//
// Entrada:
// name: Nome do container.
//
// Saída:
// id: lista de IDs dos containers
// err: Objeto de erro padrão
func (e *ContainerBuilder) ContainerFindIdByNameContains(containsName string) (list []NameAndId, err error) {
list = make([]NameAndId, 0)
e.dockerSys = iotmakerdocker.DockerSystem{}
err = e.dockerSys.Init()
if err != nil {
return
}
var receivedLis []iotmakerdocker.NameAndId
receivedLis, err = e.dockerSys.ContainerFindIdByNameContains(containsName)
if err != nil {
return
}
for _, elementInList := range receivedLis {
list = append(list, NameAndId(elementInList))
}
return
}