Handlers, DB, Cache
This commit is contained in:
37
internal/service/yookassa/module.go
Normal file
37
internal/service/yookassa/module.go
Normal file
@@ -0,0 +1,37 @@
|
||||
package yookassa
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"go.uber.org/fx"
|
||||
|
||||
"payouts/internal/config"
|
||||
)
|
||||
|
||||
var Module = fx.Options(
|
||||
fx.Provide(New),
|
||||
)
|
||||
|
||||
type params struct {
|
||||
ctx context.Context
|
||||
}
|
||||
type Optional func(*params)
|
||||
|
||||
func WithContext(ctx context.Context) Optional {
|
||||
return func(p *params) {
|
||||
p.ctx = ctx
|
||||
}
|
||||
}
|
||||
|
||||
type Service interface {
|
||||
}
|
||||
|
||||
type Param struct {
|
||||
fx.In
|
||||
|
||||
AppConfig *config.App
|
||||
}
|
||||
|
||||
func New(p Param) (Service, error) {
|
||||
return NewYookassaService(p.AppConfig.YooKassa)
|
||||
}
|
||||
Reference in New Issue
Block a user