gizmo
gizmo copied to clipboard
Generate Go Clients From Server Implementations
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
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?