initial commit

This commit is contained in:
2025-07-25 13:41:23 +02:00
commit 840de62902
27 changed files with 1772 additions and 0 deletions

15
event_stream.go Normal file
View File

@ -0,0 +1,15 @@
package niri
import (
"context"
"git.tordarus.net/tordarus/channel"
)
func (c *Client) SubscribeEvents(ctx context.Context) (<-chan Event, error) {
ch, err := subscribeSocket[*eventContainer](ctx, c.GetSocketPath(), asJsonReader("EventStream"))
if err != nil {
return nil, err
}
return channel.MapSuccessive(ch, (*eventContainer).event), nil
}