loglist: add some helper functions

This commit is contained in:
Andrew Ayer 2021-05-01 17:35:18 -04:00
parent 4b280bdcd2
commit 1a7622bfa6
1 changed files with 8 additions and 0 deletions

View File

@ -71,6 +71,14 @@ type State struct {
} `json:"rejected"`
}
func (state *State) IsApproved() bool {
return state.Qualified != nil || state.Usable != nil || state.Readonly != nil
}
func (state *State) WasApprovedAt(t time.Time) bool {
return state.Retired != nil && t.Before(state.Retired.Timestamp)
}
type LogType string
const (