Commit Graph

13 Commits

Author SHA1 Message Date
c844dc2ccb use NormalizeURL() on nip11.Fetch() 2024-03-10 18:44:56 -03:00
ec1e86e505 Support url without protocol in nip11.Fetch 2024-03-09 16:52:28 -03:00
9c4ea87d0b use stdlib "slices". 2024-02-08 16:33:39 -03:00
1ff7f826c2 nip11: url normalization improvement and Fetch test. 2024-01-13 12:46:59 -03:00
8a540998b9 nip11 fetch better errors. 2023-11-20 14:59:12 -03:00
f3c081fcd6 remove nip11 min_prefix. 2023-11-18 10:43:29 -03:00
b33fe374c1 nip11's info.AddSupportedNIP() 2023-11-18 10:32:15 -03:00
fe32ecd440 nip11: "restricted_writes". 2023-11-18 09:42:19 -03:00
Kay
ac2350c722 style: using effective go and refactoring 2023-08-21 15:50:05 -03:00
f4102ea8d2 add icon to RelayInformationDocument 2023-06-20 12:03:45 -03:00
ebae5d41e6 Add most NIP-11 extension structures to the RelayInformationDocument struct. (#80)
* Fix race condition on status in Relay.Publish method and failure to send

A race-condition exists between setting of the (unprotected) status and the callback which sets the status upon receiving an OK.
The message is sent which can receive an OK in separate goroutine (setting status) prior to the status being set to 'sent.'
The OK can be received prior to the status being set.

This fix also sets the status to PublishStatusFailed if the WriteJSON call fails.

* Add some NIP-11 extension structures to the RelayInformationDocument struct.

Added additional NIP-11 fields for relays that want to provide additional details based on NIP-11 extensions.
The retention structure has been left out as it doesn't have a clean schema for kinds (array of kinds, or pairs of kinds?)
Specified the fields w/ omitempty so marshaled will be same as original NIP-11 if nothing else is specified.
Nested structs defined as pointers so they are omitted if not specified.

* Fix TestPublishWriteFailed so that the socket is given a brief amount of time to close prior to publish being called.
The test relies on Publish always failing.
2023-04-26 08:06:05 -03:00
de78b2c054 added function to fetch NIP-11 documents 2023-01-31 14:06:15 -03:00
66aa4e9de2 add nip-11 type. 2022-07-11 15:51:24 -03:00