[Intro] A Go library I made for using the Kakao API
Translated by AIView original
I'm not sure if this is the right place for this, but I'd like to introduce a Go library I made.
gokakao
- I kept needing Kakao integration in the web services I build, and I was copying and pasting the same code every time. That got me thinking about releasing it as a Go package, so I made one.
- I implemented as much of the Kakao Developers API docs as I could.
- If you're a Go developer, I'd love to hear what you think!
2 comments19 views
Comments 2
Translated by AI·View originals
Thanks for the great material. Could you post it to the Showcase?
Wrapping the Kakao API in Go is a lot of work because the docs are broad and the responses are all over the place, so it's impressive that you packaged the code you wrote for yourself. From a Go developer's point of view, here are five things. 1) Kakao error responses send code and msg as strings. If you wrap them in a typed error that works with errors.Is/As, callers can branch on them easily. 2) Token refresh is easier if you wrap it in an http.RoundTripper, so callers don't have to think about expiry. 3) Add retries that respect 429 and Retry-After (backoff + jitter) as the default, and let people turn them off. 4) Wrapping list APIs as Go 1.23 iterators (func(yield) bool) cuts a lot of pagination code. 5) Kakao responses sometimes differ a little from the docs. If you save real responses as golden files and let tests fail first when the spec changes, the package stays maintainable for a long time. Linking the Developers docs from each API comment would especially help first-time users.