forked from arschles/deisrel
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(actions,docker): add status to tagging operation
- Loading branch information
Aaron Schlesinger
committed
Jun 9, 2016
1 parent
3ac5132
commit 1dfba28
Showing
3 changed files
with
76 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
package docker | ||
|
||
import ( | ||
"fmt" | ||
) | ||
|
||
// TagStatus represents the status of an image tagging process | ||
type TagStatus interface { | ||
fmt.Stringer | ||
Image() *Image | ||
} | ||
|
||
// TagStartStatus is the tag status that represents starting to tag an image | ||
type TagStartStatus struct { | ||
Img *Image | ||
} | ||
|
||
// String is the fmt.Stringer interface implementation | ||
func (t TagStartStatus) String() string { | ||
return fmt.Sprintf("Starting tag operation on %s", *t.Img) | ||
} | ||
|
||
// Image is the TagStatus interface implementation | ||
func (t TagStartStatus) Image() *Image { return t.Img } | ||
|
||
// TagPullStatus is the tag status that represents starting to pull an image for tagging | ||
type TagPullStatus struct { | ||
Img *Image | ||
} | ||
|
||
// String is the fmt.Stringer interface implementation | ||
func (t TagPullStatus) String() string { | ||
return fmt.Sprintf("Starting pull operation on image %s", *t.Img) | ||
} | ||
|
||
// Image is the TagStatus interface implementation | ||
func (t TagPullStatus) Image() *Image { return t.Img } | ||
|
||
// TagFinishStatus is the tag status that represents the tag operation finishing | ||
type TagFinishStatus struct { | ||
Img *Image | ||
} | ||
|
||
// String is the fmt.Stringer interface implementation | ||
func (t TagFinishStatus) String() string { | ||
return fmt.Sprintf("Finished tag operation on %s", *t.Img) | ||
} | ||
|
||
// Image is the TagStatus interface implementation | ||
func (t TagFinishStatus) Image() *Image { return t.Img } |