Versions in this module Expand all Collapse all v0 v0.0.1 May 13, 2023 Changes in this version + type Client struct + func NewClient(url string) (*Client, error) + func (c *Client) Close() error + func (c *Client) Publish(ctx context.Context, event *Event) (*CommandResult, error) + func (c *Client) Subscribe(ctx context.Context, filters []Filter) (*Subscription, error) + type CloseMessage struct + SubscriptionID string + func (m *CloseMessage) MarshalJSON() ([]byte, error) + type CommandResult struct + Message string + OK bool + type EOSEMessage struct + SubscriptionID string + type Event struct + Content string + CreatedAt int64 + ID string + Kind EventKind + PubKey string + Sig string + Tags []Tag + func (e *Event) Sign(privKey string) error + type EventKind int64 + const EventKindBadgeAward + const EventKindChannelCreation + const EventKindChannelHideMessage + const EventKindChannelMessage + const EventKindChannelMetadata + const EventKindChannelMuteUser + const EventKindContacts + const EventKindEncryptedDirectMessages + const EventKindEventDeletion + const EventKindFileMetadata + const EventKindReaction + const EventKindRecommendServer + const EventKindReporting + const EventKindReposts + const EventKindSetMetadata + const EventKindTextNote + const EventKindZap + const EventKindZapRequest + type EventMessage struct + Event *Event + SubscriptionID string + func (m *EventMessage) MarshalJSON() ([]byte, error) + type Filter struct + Authors []string + IDs []string + Kinds []EventKind + Limit int + Search string + Since int64 + Tags []Tag + Until int64 + type MessageType string + const MessageTypeClose + const MessageTypeEOSE + const MessageTypeEvent + const MessageTypeNotice + const MessageTypeOK + const MessageTypeReq + type NoticeMessage struct + Message string + type OKMessage struct + EventID string + Message string + OK bool + type ReqMessage struct + Filters []Filter + SubscriptionID string + func (m *ReqMessage) MarshalJSON() ([]byte, error) + type Subscription struct + func (s *Subscription) ID() string + func (s *Subscription) Receive(ctx context.Context, f func(context.Context, *Event)) error + type Tag []string