refactor: migrate repo to struct

This commit is contained in:
2025-01-14 11:49:42 +03:00
parent e827fb8049
commit 91937a1fc5
9 changed files with 273 additions and 152 deletions

29
pkg/repos/repos.go Normal file
View File

@ -0,0 +1,29 @@
package repos
import (
"context"
"plemya-x.ru/alr/internal/config"
database "plemya-x.ru/alr/internal/db"
"plemya-x.ru/alr/internal/types"
)
type Config interface {
GetPaths(ctx context.Context) *config.Paths
Repos(ctx context.Context) []types.Repo
}
type Repos struct {
cfg Config
db *database.Database
}
func New(
cfg Config,
db *database.Database,
) *Repos {
return &Repos{
cfg,
db,
}
}