mirror of
https://github.com/containrrr/watchtower.git
synced 2026-01-23 09:16:09 +01:00
http report wip
This commit is contained in:
parent
e3dd8d688a
commit
efaf7190ee
25 changed files with 350 additions and 284 deletions
24
pkg/session/session.go
Normal file
24
pkg/session/session.go
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
package session
|
||||
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
type Session struct {
|
||||
Trigger Trigger
|
||||
Started time.Time
|
||||
Progress Progress
|
||||
}
|
||||
|
||||
func New(trigger Trigger) *Session {
|
||||
return &Session{
|
||||
Started: time.Now().UTC(),
|
||||
Trigger: trigger,
|
||||
Progress: Progress{},
|
||||
}
|
||||
}
|
||||
|
||||
// Report creates a new Report from a Session instance
|
||||
func (s Session) Report() *Report {
|
||||
return NewReport(s.Started, time.Now().UTC(), s.Trigger, s.Progress)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue