refactor: migrate repo to struct
This commit is contained in:
29
pkg/repos/repos.go
Normal file
29
pkg/repos/repos.go
Normal 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,
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user