You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
418 B
Go
25 lines
418 B
Go
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)
|
|
}
|