Files
services/location/subscriber/subscriber.go
Asim Aslam 25ae1f2b98 Add location service (#29)
* Add location service

* Update README.md
2020-11-17 22:22:33 +00:00

22 lines
364 B
Go

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
}