first commit

This commit is contained in:
Robin Olsen
2026-01-31 16:00:23 +01:00
commit a3a1d71325
23 changed files with 614 additions and 0 deletions

26
internal/service/beads.go Normal file
View File

@@ -0,0 +1,26 @@
package service
import (
"context"
"fmt"
"github.com/steveyegge/beads"
)
type Service struct {
beads.Storage
}
func NewService(ctx context.Context, storage beads.Storage, prefix string) (*Service, error) {
issue_prefix, err := storage.GetConfig(ctx, "issue_prefix")
if err != nil || issue_prefix == "" {
if err := storage.SetConfig(ctx, "issue_prefix", prefix); err != nil {
return nil, fmt.Errorf("failed to set issue_prefix: %w", err)
}
fmt.Println("Initialized with prefix:", prefix)
}
return &Service{
Storage: storage,
}, nil
}

View File

@@ -0,0 +1,13 @@
package service
import "beadstest/internal/storage"
type StatisticsService struct {
storage *storage.StatisticsStorage
}
func NewStatisticsService(storage *storage.StatisticsStorage) *StatisticsService {
return &StatisticsService{
storage: storage,
}
}