Developing a Go API client: the do's and don'ts

Maintaining an open-source API client takes some effort. Not only do you have to reflect the API, you also want to provide the best developer experience possible. This talk is about best practices you should use when writing Go API clients while maintaining flexibility & stability in the long term.

Abstract

Maintaining an open-source API client takes some effort. Not only do you have to reflect the API, you also want to provide the best developer experience possible. This talk is about best practices you should use when writing Go API clients while maintaining flexibility & stability in the long term.

Algolia’s core product is a distributed search API; therefore, it must provide a developer-friendly and stable API client. Thanks to what we’ve learned from our users and our own experiences, we’re going to discuss best practices on how to reach those goals when designing and implementing a Go API client.
Compared to other programming languages, which offer looser constraints (typing system, more granular control over visibility, etc.) or more high-level abstractions (genericity, default arguments, etc.), Go feels minimal. To provide high-quality packages, you have to be creative. When it was time to release the new major version of our Go API client, we made sure to explore and use every possible feature of the language, as well as its tooling, to provide a state-of-the-art library.

In this talk, we’ll cover, among other topics:
•How to plan for backward-compatibility
•Why Go generics are not always needed
•Providing flexible and public API
•How useful the empty interface can be
•Using channels sparingly
•Designing a fast and concurrent testing suite for integration tests

Video

Made by DEVELER

GoLab is a conference made by Develer.
Develer is a company based in Campi Bisenzio, near Florence. Our motto is : "Technology to give life to your products". We produce hardware and software to create exceptional products and to improve industrial processes and people's well being.
In Develer we have passion for the new technologies and we offer our clients effective solutions that are also efficient, simple and safe for the end users. We also believe in a friendly and welcoming environment where anybody can give their contribution. This passion and this vision are what we've been driven to organize our conference "made by developers for developers".


Subscribe to our newsletter

We hate spam just as much as you do, which is why we promise to only send you relevant communications. We respect your privacy and will never share your information with third parties.
©2024 GoLab | The international conference on Go in Florence-Design & devCantiere Creativo-Made withDatoCMS