Recipe 26Using a Function Registry

Task

You’re working with the operations team to help with the visibility of your website. Sophia, who leads the ops team, opens an issue for you:

Currently our metrics server exposes metrics in JSON format. However, we’d like to expose metrics in different formats. Currently there’s a demand for CSV and XML formats. But let’s make it flexible so that adding new formats won’t be a lot of work.

After a follow-up session that helps you understand the requirements and the formats better, you’re ready to start coding. You decide to implement CSV first and once it’s approved add XML.

Metric Database

images/aside-icons/tip.png

In real production ...

Get Effective Go Recipes 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.