Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Hands-On Microservices with Kubernetes

You're reading from   Hands-On Microservices with Kubernetes Build, deploy, and manage scalable microservices on Kubernetes

Arrow left icon
Product type Paperback
Published in Jul 2019
Publisher
ISBN-13 9781789805468
Length 502 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Gigi Sayfan Gigi Sayfan
Author Profile Icon Gigi Sayfan
Gigi Sayfan
Arrow right icon
View More author details
Toc

Table of Contents (16) Chapters Close

Preface 1. Introduction to Kubernetes for Developers FREE CHAPTER 2. Getting Started with Microservices 3. Delinkcious - the Sample Application 4. Setting Up the CI/CD Pipeline 5. Configuring Microservices with Kubernetes 6. Securing Microservices on Kubernetes 7. Talking to the World - APIs and Load Balancers 8. Working with Stateful Services 9. Running Serverless Tasks on Kubernetes 10. Testing Microservices 11. Deploying Microservices 12. Monitoring, Logging, and Metrics 13. Service Mesh - Working with Istio 14. The Future of Microservices and Kubernetes 15. Other Books You May Enjoy

Providing and consuming an internal gRPC API

The service we will implement in this section is called the news service. Its job is to keep track of link events, such as link added or link updated, and return new events to users.

Defining the NewsManager interface

This interface exposes a single GetNews() method. Users may invoke it and receive a list of link events from users they follow. Here is the Go interface and related structs. It doesn't get much simpler: a single method with a request struct with username and token fields, as well as a result struct. The resulting struct contains a list of Event structs with the following information: EventType, Username, Url, and Timestamp:

type NewsManager interface {
      ...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime