mirror of
https://github.com/containrrr/watchtower.git
synced 2025-12-15 14:40:13 +01:00
feat(docs): add template preview (#1777)
This commit is contained in:
parent
9b28fbc24d
commit
9180e9558e
15 changed files with 944 additions and 20 deletions
44
pkg/notifications/preview/data/status.go
Normal file
44
pkg/notifications/preview/data/status.go
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
package data
|
||||
|
||||
import wt "github.com/containrrr/watchtower/pkg/types"
|
||||
|
||||
type containerStatus struct {
|
||||
containerID wt.ContainerID
|
||||
oldImage wt.ImageID
|
||||
newImage wt.ImageID
|
||||
containerName string
|
||||
imageName string
|
||||
error
|
||||
state State
|
||||
}
|
||||
|
||||
func (u *containerStatus) ID() wt.ContainerID {
|
||||
return u.containerID
|
||||
}
|
||||
|
||||
func (u *containerStatus) Name() string {
|
||||
return u.containerName
|
||||
}
|
||||
|
||||
func (u *containerStatus) CurrentImageID() wt.ImageID {
|
||||
return u.oldImage
|
||||
}
|
||||
|
||||
func (u *containerStatus) LatestImageID() wt.ImageID {
|
||||
return u.newImage
|
||||
}
|
||||
|
||||
func (u *containerStatus) ImageName() string {
|
||||
return u.imageName
|
||||
}
|
||||
|
||||
func (u *containerStatus) Error() string {
|
||||
if u.error == nil {
|
||||
return ""
|
||||
}
|
||||
return u.error.Error()
|
||||
}
|
||||
|
||||
func (u *containerStatus) State() string {
|
||||
return string(u.state)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue