add an email service

This commit is contained in:
Asim Aslam
2021-07-01 12:37:12 +01:00
parent 97298b9cfb
commit eb0165f4bf
11 changed files with 567 additions and 0 deletions

27
email/main.go Normal file
View File

@@ -0,0 +1,27 @@
package main
import (
"github.com/micro/micro/v3/service"
"github.com/micro/micro/v3/service/logger"
"github.com/micro/services/email/handler"
pb "github.com/micro/services/email/proto"
"github.com/micro/services/pkg/tracing"
)
func main() {
// Create service
srv := service.New(
service.Name("email"),
service.Version("latest"),
)
// Register handler
pb.RegisterEmailHandler(srv.Server(), handler.NewEmailHandler())
traceCloser := tracing.SetupOpentracing("email")
defer traceCloser.Close()
// Run service
if err := srv.Run(); err != nil {
logger.Fatal(err)
}
}