11 Commits

Author SHA1 Message Date
2641327c28 support for EOSE and OK messages on relay/subscription. 2022-11-12 21:49:57 -03:00
c4d52e516f change relaypool and subscription such that a Relay can have an independent existence. 2022-11-06 21:15:42 -03:00
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
9549c3624a nostr package, readme updates accordingly, matching example program (#14) 2022-10-12 17:24:30 -03:00
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
1f1d3cfe7f some changes and fixes related to sub.Sub(). 2022-05-04 12:39:10 -03:00
86853004ef change parsing so NIP12 can work, rename types. 2022-02-08 16:27:33 -03:00
ef1f548212 avoid sending to closed Events/UniqueEvents channels. 2022-02-07 11:33:45 -03:00
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
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
d131e8460e move everything to the same directory. 2022-01-02 08:44:18 -03:00