fx build fix
This commit is contained in:
21
api/notification/interface/api/api.go
Normal file
21
api/notification/interface/api/api.go
Normal file
@@ -0,0 +1,21 @@
|
||||
package api
|
||||
|
||||
import (
|
||||
"github.com/tech/sendico/notification/interface/api/localizer"
|
||||
"github.com/tech/sendico/pkg/db"
|
||||
"github.com/tech/sendico/pkg/domainprovider"
|
||||
"github.com/tech/sendico/pkg/messaging"
|
||||
"github.com/tech/sendico/pkg/mlogger"
|
||||
"github.com/tech/sendico/pkg/mservice"
|
||||
)
|
||||
|
||||
type API interface {
|
||||
Config() *Config
|
||||
DBFactory() db.Factory
|
||||
Logger() mlogger.Logger
|
||||
Register() messaging.Register
|
||||
Localizer() localizer.Localizer
|
||||
DomainProvider() domainprovider.DomainProvider
|
||||
}
|
||||
|
||||
type MicroServiceFactoryT = func(API) (mservice.MicroService, error)
|
||||
13
api/notification/interface/api/config.go
Normal file
13
api/notification/interface/api/config.go
Normal file
@@ -0,0 +1,13 @@
|
||||
package api
|
||||
|
||||
import (
|
||||
mwa "github.com/tech/sendico/notification/interface/middleware"
|
||||
amp "github.com/tech/sendico/notification/interface/services/amplitude/config"
|
||||
not "github.com/tech/sendico/notification/interface/services/notification/config"
|
||||
)
|
||||
|
||||
type Config struct {
|
||||
Mw *mwa.Config `yaml:"middleware"`
|
||||
Notification *not.Config `yaml:"notification"`
|
||||
Amplitude *amp.Config `yaml:"amplitude"`
|
||||
}
|
||||
19
api/notification/interface/api/localizer/localizer.go
Normal file
19
api/notification/interface/api/localizer/localizer.go
Normal file
@@ -0,0 +1,19 @@
|
||||
package localizer
|
||||
|
||||
import (
|
||||
lclrimp "github.com/tech/sendico/notification/internal/localizer"
|
||||
"github.com/tech/sendico/pkg/mlogger"
|
||||
)
|
||||
|
||||
type Config = *lclrimp.Config
|
||||
|
||||
type Localizer interface {
|
||||
LocalizeTemplate(id string, templateData, ctr any, lang string) (string, error)
|
||||
LocalizeString(id, lang string) (string, error)
|
||||
ServiceName() string
|
||||
SupportMail() string
|
||||
}
|
||||
|
||||
func CreateLocalizer(logger mlogger.Logger, config *Config) (Localizer, error) {
|
||||
return lclrimp.CreateLocalizer(logger, *config)
|
||||
}
|
||||
Reference in New Issue
Block a user