The service implementation

The next layer is implementing the service interfaces as simple Go packages. At this point, each service has its own package:

  • github.com/the-gigi/delinkcious/pkg/link_manager
  • github.com/the-gigi/delinkcious/pkg/user_manager
  • github.com/the-gigi/delinkcious/pkg/social_graph_manager

Note that these are Go package names and not URLs.

Let's examine the social_graph_manager package. It imports the object_model package as om because it needs to implement the om.SocialGraphManager interface. It defines a struct called SocialGraphManager that has a field called store of the om.SocialGraphManager type. So, the interface of the store field is identical to the interface of the manager in this case:

package social_graph_manager ...

Get Hands-On Microservices with Kubernetes now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.