Commit 620b3a0
cmd/stanuki/main.go
@@ -5,13 +5,15 @@ import (
"fmt"
"github.com/xlgmokha/x/pkg/env"
+ "gitlab.com/mokhax/stanuki/pkg/db"
"gitlab.com/mokhax/stanuki/pkg/gitlab"
)
func main() {
+ issues := db.New[*gitlab.Issue]("./db/issues")
gl := gitlab.New(context.TODO(), env.Fetch("GITLAB_TOKEN", ""))
-
gl.Group(9970).EachIssue(func(issue *gitlab.Issue) {
fmt.Printf("%v: %v\n", issue.ID, issue.Title)
+ issues.Save(issue)
})
}
pkg/db/client.go
@@ -0,0 +1,15 @@
+package db
+
+type Storage[T any] struct {
+ dir string
+}
+
+func New[T any](dir string) *Storage[T] {
+ return &Storage[T]{
+ dir: dir,
+ }
+}
+
+func (db *Storage[T]) Save(item T) error {
+ return nil
+}