Our great sponsors
-
optic
A simplified, generic, entity based web library for golang that's drop in compatible with net/http (by nanvenomous)
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
-
revive
🔥 ~6x faster, stricter, configurable, extensible, and beautiful drop-in replacement for golint
I did a version bump, here are the changes: - refined the the error handling - tried a few things, settled on an interface for the status code & a generic type for the error body. These seem to play really well together for the moment - You now need to provide the error type as well as the errors you want to send during encoding & decoding failures in order to even use the library. - This makes the initial configuration a little more cumbersome, but increases the transparency & still makes it quite simple and fun to define Mirrors (optic service routes) - rename Exception to HttpError - Would love any more feedback if this improves some of the initial qualms. - successfully remove S & R generics from Glance (still unsure if this is possible for Mirror) - began removing some unused code & un-exporting non-essentials. I believe this might be futile until I can scope all possible breaking changes
I've been writing a WASM app using gio & I found myself wanting for a simplified web library. In addition I drew some inspiration from leptos server functions. A friend of mine mentioned it has some similarities with next.js
I would suggest checking out something like revive to improve the code. For instance you use an errors.New(fmt.Sprintf(... when you can just use fmt.Errorf(... to simplify it. I am not saying obey everything but there are some good lints included that can even catch bugs (for instance misusing errors.Is or errors.As or general equality).
I have a plan to add wasm fetch as a dependency under a build tag only for js builds using the appropriate build tags. Hadn't thought further than that. Any examples of a websocket implementation you could provide? I think I need to figure out this error handling portion first.