diff options
| -rw-r--r-- | cmd/stanuki/main.go | 4 | ||||
| -rw-r--r-- | pkg/db/client.go | 15 |
2 files changed, 18 insertions, 1 deletions
diff --git a/cmd/stanuki/main.go b/cmd/stanuki/main.go index 9b4fca3..0588809 100644 --- a/cmd/stanuki/main.go +++ b/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) }) } diff --git a/pkg/db/client.go b/pkg/db/client.go new file mode 100644 index 0000000..39d3f9e --- /dev/null +++ b/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 +} |
