gizmo icon indicating copy to clipboard operation
gizmo copied to clipboard

Generate Go Clients From Server Implementations

Open marwan-at-work opened this issue 5 years ago • 1 comments

Any server implementation should have a code generator that creates an idiomatic client for it where the end user has only two exported APIs:

type Service interface { ... } // contains all API calls. 
func NewService(client *http.Client, url string) Service

marwan-at-work avatar Feb 08 '19 04:02 marwan-at-work

I'm a bit more inclined to go the document-driven approach. Create a API spec and then create servers and clients based on the contract.

Also, if we do build a tool that enables this, I think we may want it in it's own repo and have the generation tied to a specific version. Thoughts?

jprobinson avatar Feb 08 '19 21:02 jprobinson