service backend
This commit is contained in:
18
api/pkg/messaging/natsb/nats.go
Normal file
18
api/pkg/messaging/natsb/nats.go
Normal file
@@ -0,0 +1,18 @@
|
||||
package messaging
|
||||
|
||||
import (
|
||||
"github.com/mitchellh/mapstructure"
|
||||
mb "github.com/tech/sendico/pkg/messaging/broker"
|
||||
"github.com/tech/sendico/pkg/messaging/internal/natsb"
|
||||
nc "github.com/tech/sendico/pkg/messaging/internal/natsb/config"
|
||||
"github.com/tech/sendico/pkg/mlogger"
|
||||
"github.com/tech/sendico/pkg/model"
|
||||
)
|
||||
|
||||
func NewNATSBroker(logger mlogger.Logger, config model.SettingsT) (mb.Broker, error) {
|
||||
var conf nc.Settings
|
||||
if err := mapstructure.Decode(config, &conf); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return natsb.NewNatsBroker(logger, &conf)
|
||||
}
|
||||
Reference in New Issue
Block a user