mirror of
https://github.com/kevin-DL/services.git
synced 2026-01-11 19:04:35 +00:00
33 lines
672 B
Go
33 lines
672 B
Go
package main
|
|
|
|
import (
|
|
"github.com/micro/micro/v3/service"
|
|
"github.com/micro/micro/v3/service/logger"
|
|
"github.com/micro/micro/v3/service/store"
|
|
|
|
otp "github.com/micro/services/otp/proto"
|
|
"github.com/micro/services/pkg/tracing"
|
|
"github.com/micro/services/user/handler"
|
|
proto "github.com/micro/services/user/proto"
|
|
)
|
|
|
|
func main() {
|
|
srv := service.New(
|
|
service.Name("user"),
|
|
)
|
|
srv.Init()
|
|
|
|
hd := handler.NewUser(
|
|
store.DefaultStore,
|
|
otp.NewOtpService("otp", srv.Client()),
|
|
)
|
|
|
|
proto.RegisterUserHandler(srv.Server(), hd)
|
|
traceCloser := tracing.SetupOpentracing("user")
|
|
defer traceCloser.Close()
|
|
|
|
if err := srv.Run(); err != nil {
|
|
logger.Fatal(err)
|
|
}
|
|
}
|