feat: implemented service/transport/main layers

This commit is contained in:
Anatoly Antonov 2025-06-21 22:06:32 +03:00
parent 5158c5d7c9
commit bcb9ace54c
29 changed files with 804 additions and 393 deletions

16
internal/service/deps.go Normal file
View file

@ -0,0 +1,16 @@
package service
import (
"context"
"time"
)
type Redis interface {
Lock(ctx context.Context, key string, ttl time.Duration) (func(context.Context), error)
Set(key string, value []byte, ttl time.Duration) error
Get(key string) ([]byte, error)
}
type Downloader interface {
Download(ctx context.Context)
}

View file

@ -0,0 +1,13 @@
package service
import (
"context"
"net/http"
"git.intra.yksa.space/gsn/predictor/internal/pkg/ds"
"git.intra.yksa.space/gsn/predictor/internal/pkg/errcodes"
)
func (s *Service) PerformPrediction(ctx context.Context, params ds.PredictionParameters) ([]ds.PredicitonResult, error) {
return nil, errcodes.New(http.StatusNotImplemented, "not implemented", "please wait")
}

View file

@ -0,0 +1,10 @@
package service
type Service struct {
redis Redis
downloader Downloader
}
func New() *Service {
return &Service{}
}