mirror of
https://github.com/kevin-DL/services.git
synced 2026-01-11 19:04:35 +00:00
25 lines
482 B
Go
25 lines
482 B
Go
package main
|
|
|
|
import (
|
|
"log"
|
|
|
|
"github.com/micro/micro/v3/service"
|
|
"github.com/micro/services/location/handler"
|
|
pb "github.com/micro/services/location/proto"
|
|
"github.com/micro/services/location/subscriber"
|
|
)
|
|
|
|
func main() {
|
|
location := service.New(
|
|
service.Name("location"),
|
|
)
|
|
|
|
pb.RegisterLocationHandler(location.Server(), new(handler.Location))
|
|
|
|
service.Subscribe(subscriber.Topic, new(subscriber.Location))
|
|
|
|
if err := location.Run(); err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
}
|