feat: more options
Some checks failed
Go / build (push) Failing after 1m16s

This commit is contained in:
2025-11-04 20:16:44 +01:00
parent 8f5ae15ef0
commit cfbb475a42
6 changed files with 58 additions and 22 deletions

View File

@@ -3,10 +3,29 @@ package invoice
import (
"io"
"log/slog"
"time"
"code.gitea.io/sdk/gitea"
)
var DefaultOptions = Options{
Mindur: time.Minute * 15,
Since: time.Now().AddDate(0, -1, 0),
Before: time.Now(),
IssueState: gitea.StateClosed,
IssueFilter: func(i *gitea.Issue) bool {
return i.Closed != nil && i.Closed.After(time.Now().AddDate(0, -1, 0))
},
}
type Options struct {
Mindur time.Duration
Since time.Time
Before time.Time
IssueState gitea.StateType
IssueFilter func(i *gitea.Issue) bool
}
type Repo struct {
Owner string `json:"owner"`
Repo string `json:"repo"`