fiatjaf
4b1f69ec27
subscriptions receive their context on Prepare().
2023-03-21 14:50:34 -03:00
fiatjaf
46e724b8d5
dry sub.unsub() on context cancelation.
2023-03-18 16:07:19 -03:00
fiatjaf
85fc74fd22
fixing subscription labels and ids.
2023-03-18 15:09:49 -03:00
fiatjaf
3f66c60b5f
subscription labels: GetID() and SetLabel().
2023-03-18 08:40:12 -03:00
fiatjaf
fdc99d61b6
subscription ids as sequential numbers and sub.GetID()
2023-03-17 16:43:48 -03:00
fiatjaf
0765f7b91b
context cancelation for relay connections and subscriptions.
2023-03-16 14:16:46 -03:00
fiatjaf
92c0143762
make sub.Events a channel of pointers.
2023-01-26 09:04:27 -03:00
barkyq
87b6280299
Added some NIP-42 functionality to the client (relay.go) ( #38 )
2023-01-16 08:27:11 -03:00
barkyq
a37ffacc74
added sub.mutex handling in the relay Connect() function ( #37 )
2023-01-15 09:19:00 -03:00
fiatjaf
4a62a753e6
contexts everywhere.
2023-01-01 20:58:43 -03:00
fiatjaf
2d01aa8630
prevent sending on closed channel for subscription.
2022-11-26 09:25:51 -03:00
fiatjaf
b0ae497656
allow more fine-grained control over subscription filters.
2022-11-19 14:00:29 -03:00
fiatjaf
8bc91a894c
sub.GetFilters()
2022-11-19 07:19:36 -03:00
fiatjaf
69ccfbaa08
protect against faulty relays that send more than one EOSE halting us
...
using sync.Once{} to only emit to the EndOfStoredEvents channel once
(it has capacity 1 so anything over that would halt).
2022-11-16 10:07:37 -03:00
fiatjaf
2641327c28
support for EOSE and OK messages on relay/subscription.
2022-11-12 21:49:57 -03:00
fiatjaf
c4d52e516f
change relaypool and subscription such that a Relay can have an independent existence.
2022-11-06 21:15:42 -03:00
fiatjaf
329b8d44d2
move stuff back from nostr package to top level.
...
because otherwise the path must be specified as github.com/fiatjaf/go-nostr/nostr, which is annoying.
2022-11-04 08:22:13 -03:00
BitcoinCoderBob
9549c3624a
nostr package, readme updates accordingly, matching example program ( #14 )
2022-10-12 17:24:30 -03:00
fiatjaf
cea3004867
update to go1.18 and use generic sync maps instead of normal maps.
...
fixes https://github.com/fiatjaf/go-nostr/issues/12
2022-08-22 08:45:39 -03:00
fiatjaf
1f1d3cfe7f
some changes and fixes related to sub.Sub().
2022-05-04 12:39:10 -03:00
fiatjaf
86853004ef
change parsing so NIP12 can work, rename types.
2022-02-08 16:27:33 -03:00
fiatjaf
ef1f548212
avoid sending to closed Events/UniqueEvents channels.
2022-02-07 11:33:45 -03:00
Honza Pokorny
a3df2cb893
Add mutexes around websockets
...
We replace the bare websocket.Conn type with a new Connection type which
implements `WriteJSON`, `WriteMessage`, and `Close`. The Connection
type adds mutexes around writes since gorilla doesn't support concurrent
writes to websockets.
Signed-off-by: Honza Pokorny <honza@pokorny.ca>
2022-01-12 12:19:33 -03:00
Honza Pokorny
26c3b4aac9
Remove unnecessary argument to subscription.Sub
...
The `Sub()` function retrieves the list of filters from the
`Subscripton` object itself, and therefore it's unnecessary to pass it
in. The argument is unused.
Here, we remove the function argument from the definition, and from the
single call site. We then pass the filters to the initializer.
This makes it so that filters are in fact passed to the relay on the wire.
2022-01-04 12:24:05 -03:00
fiatjaf
d131e8460e
move everything to the same directory.
2022-01-02 08:44:18 -03:00