mleku on Nostr: classic example of how #golang does #composition better than any other language took ...
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...
Published at
2025-02-24 19:00:41Event JSON
{
"id": "4c1de51bb910e45a0e1f6e232becd5e4fe39a7ce28f31fa2235035f631d90038",
"pubkey": "4c800257a588a82849d049817c2bdaad984b25a45ad9f6dad66e47d3b47e3b2f",
"created_at": 1740423641,
"kind": 1,
"tags": [
[
"t",
"golang"
],
[
"t",
"composition"
],
[
"t",
"realy"
],
[
"client",
"jumble"
]
],
"content": "classic example of how #golang does #composition better than any other language\n\ntook 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\n\nit 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\n\nnow 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\n\ni 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\n\ncontinuing...",
"sig": "52533b7350794279db1ea2787d408ba416a32b038cb48a6039362a6083eae18ab27d1487c211453cb2d1dc15c89ea60e3bd7a0870589661abc93f94cca1c885c"
}