Open qdm12 opened 4 years ago
I did a quick look online and the Iris framework seems to be a good choice for an API https://github.com/kataras/iris It is actively maintained, very few issues are opened, there are loads of up to date examples. It looks easy to use/implement. What do you think?
Ehh sorry to disappoint, but I'd like to stay away from frameworks. Especially we just need I think a GET, POST and PUT endpoints and call it a day 👍 I'm fine with adding a (good, idiomatic, close to the Go standard library) router like go-chi though.
I'm very used to write HTTP servers in Go, what I can do is lay some foundations and then you can fill it up? But that will probably have to wait until the weekend 😄
I was suggesting Iris because it looks super easy and readable from what I read from the section "Simple Handler" of their Readme.md . Also, I believe the go compiler removes unused code so using a framework shouldn't introduce too much heaviness. Anyway, I'm afraid to write an API in Go without structure, that's the main reason I suggested a framework. If you lay down some foundation I sure will be happy to help
Anyway, I'm afraid to write an API in Go without structure
Totally understandable. It took me a while to figure a good structure, and I constantly see oddities in how HTTP servers are implemented / non testable. So it is not trivial indeed 😄
Right now I'm in the middle of solving #136 and will get to the HTTP server right after.
I came to suggest a similar feature. In my case, I would only need read support on such API. My goal is to show a summary in a Homepage widget so I can see if everything is fine or if something needs my attention.
Perhaps this could come as a first iteration before considering config changes 👼 .
Setup a simple HTTP server to serve information and modify settings
Such that it can be used as an API consumed by the web ui react frontend