forked from simplesurance/baur
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dockerjob.go
41 lines (33 loc) · 884 Bytes
/
dockerjob.go
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
package upload
import "fmt"
// DockerJob is a docker container upload job
type DockerJob struct {
UserData interface{}
ImageID string
Repository string
Tag string
}
// LocalPath returns the image id of the container
func (d *DockerJob) LocalPath() string {
return d.ImageID
}
// RemoteDest returns the upload path in the docker registry
func (d *DockerJob) RemoteDest() string {
return d.Repository + ":" + d.Tag
}
// Type returns the JobDocker
func (d *DockerJob) Type() JobType {
return JobDocker
}
// GetUserData returns the UserData
func (d *DockerJob) GetUserData() interface{} {
return d.UserData
}
// SetUserData sets the UserData
func (d *DockerJob) SetUserData(u interface{}) {
d.UserData = u
}
// String returns the string representation
func (d *DockerJob) String() string {
return fmt.Sprintf("%s -> %s:%s", d.ImageID, d.Repository, d.Tag)
}