Add location service (#29)

* Add location service

* Update README.md
This commit is contained in:
Asim Aslam
2020-11-17 22:22:33 +00:00
committed by GitHub
parent 8f8e9a3a06
commit 25ae1f2b98
15 changed files with 869 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
package subscriber
import (
"context"
"log"
"github.com/micro/services/location/domain"
proto "github.com/micro/services/location/proto"
)
var (
Topic = "location"
)
type Location struct{}
func (g *Location) Handle(ctx context.Context, e *proto.Entity) error {
log.Printf("Saving entity ID %s", e.Id)
domain.Save(domain.ProtoToEntity(e))
return nil
}