Skip to content

Instantly share code, notes, and snippets.

@pot-code
Created March 25, 2021 08:49
Show Gist options
  • Save pot-code/017ba8fe3778a10668a2256a050fc647 to your computer and use it in GitHub Desktop.
Save pot-code/017ba8fe3778a10668a2256a050fc647 to your computer and use it in GitHub Desktop.
[go-wire]
//+build wireinject
package api
import (
"github.com/google/wire"
"github.com/pot-code/go-producer/api/notification"
ut "github.com/pot-code/go-producer/api/notification/transport"
"github.com/pot-code/go-producer/pkg/db"
"github.com/pot-code/go-producer/pkg/uuid"
"github.com/pot-code/go-producer/pkg/validate"
)
func InitializeNotificationHandler(conn db.ITransactionalDB, uid uuid.UUIDer) *ut.NotificationHandler {
wire.Build(validate.NewValidator,
wire.Bind(new(notification.NotificationUseCase), new(*notification.NotificationService)),
wire.Bind(new(notification.NotificationRepository), new(*notification.NotificationStore)),
notification.NewNotificationService,
notification.NewNotificationRepository,
ut.NewNotificationHandler,
)
return &ut.NotificationHandler{}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment