mleku @mleku - 6h
classic example of how #golang does #composition better than any other language took me all of about 30 minutes to completely refactor #realy to separate the "filter" out of the filter type, which i achived by extracting the fields (kinds/authors/tags/since/until) from the existing plain muddled "filter" structure it is now called `simple.Filter` and the reason for doing this was to make a single structure that embeds elsewhere that is the primary parameters for an actual `/filter` request on the simplified nostr HTTP API now i have a full interface composed of single APIs so i can treat them as a whole or separately... it was an important step on the path to implementing a full simplified API i did add a `/subscribe-fulltext` endpoint to distinguish between the words-and-filter distinction instead of repeating the same mistake of making "optional" things when i want them to be extensions continuing...
yes, i'm not 100% certain this is all 100% to be honest but there is no errors and the relay seems to be behaving exactly as it was before, as it should be so this is great, anyway, it means i can write code that handles this part of it, which i probably already wrote, and just move it into separate functions, and this becomes the simplified API and the legacy API just uses that code as part of its process the same will happen to the event request as well
mleku @mleku - 5h
just to clarify when you "embed" a struct in another struct in golang, pointer or directly, the methods associated with the type also become accessible from the type that has the new embedding additionally, code that accessed those same fields that now are part of the embedded struct, have no change in syntax unless there is a conflict with another field name (which basically can't happen) so the process of popping out a subset of a struct into a new struct is absurdly simple and smooth in #golang no other language makes this as easy
go has closures as well, and prototypes smell objecty to me