July 2019
Intermediate to advanced
502 pages
14h
English
Let's run the link manager service locally via Telepresence. First, to demonstrate that it is really the local service that is running, we can modify the service code. For example, we can print a message when getting links, that is, "**** Local link service here! calling GetLinks() ****".
Let's add it to the GetLinks endpoint in svc/link_service/service/transport.go:
func makeGetLinksEndpoint(svc om.LinkManager) endpoint.Endpoint { return func(_ context.Context, request interface{}) (interface{}, error) { fmt.Println("**** Local link service here! calling GetLinks() ****") req := request.(om.GetLinksRequest) result, err := svc.GetLinks(req) res := getLinksResponse{} for _, link := range result.Links ...