Documentation ¶
Index ¶
- func CloseSubscription(ctx context.Context, t *testing.T, subID messages.SubscriptionID, ...)
- func Event(t require.TestingT, opts ...EventOptions) event.Event
- func EventWithContent(t require.TestingT, content string) event.Event
- func EventWithCreatedAt(t require.TestingT, createdAt time.Time) event.Event
- func EventWithKind(t require.TestingT, kind int) event.Event
- func EventWithPTagReferenceTo(t require.TestingT, pubKey event.PubKey) event.Event
- func EventWithPrivKey(t require.TestingT, pk PrivKey) event.Event
- func EventWithTags(t require.TestingT, tags nostr.Tags) event.Event
- func GetEvent(ctx context.Context, t *testing.T, id event.ID) (event.Event, bool)
- func ListenForEventsOnSub(ctx context.Context, t *testing.T, read <-chan MsgRead, ...) chan event.Event
- func NewConnection(t *testing.T) *nostr.Relay
- func NewSocket(ctx context.Context, t require.TestingT, opts ...SocketOpts) (MsgWriter, <-chan MsgRead, Closer)
- func Publish(ctx context.Context, t require.TestingT, e event.Event, conn MsgWriter)
- func ReadEvent(ctx context.Context, t *testing.T, read <-chan MsgRead, ...) (event.Event, bool)
- func SetDefaultURI(uri string)
- func StoredEvents(t *testing.T, read <-chan MsgRead, sub messages.SubscriptionID, ...) ([]event.Event, error)
- type Closer
- type EventOptions
- type MsgRead
- type MsgWriter
- type PrivKey
- type PubKey
- type SocketOpts
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CloseSubscription ¶ added in v0.1.8
func EventWithContent ¶ added in v0.1.7
func EventWithCreatedAt ¶ added in v0.1.7
func EventWithPTagReferenceTo ¶ added in v0.1.7
func EventWithPrivKey ¶ added in v0.1.7
func EventWithTags ¶ added in v0.1.7
func ListenForEventsOnSub ¶
func SetDefaultURI ¶ added in v0.1.7
func SetDefaultURI(uri string)
Types ¶
type EventOptions ¶
type EventOptions struct { PrivKey PrivKey CreatedAt time.Time Kind int Tags nostr.Tags Content string }
func WithContent ¶ added in v0.1.7
func WithContent(content string) EventOptions
func WithCreatedAt ¶ added in v0.1.7
func WithCreatedAt(createdAt time.Time) EventOptions
func WithKind ¶ added in v0.1.7
func WithKind(kind int) EventOptions
func WithPrivKey ¶ added in v0.1.7
func WithPrivKey(pk PrivKey) EventOptions
func WithTags ¶ added in v0.1.7
func WithTags(tags nostr.Tags) EventOptions
type MsgWriter ¶ added in v0.1.8
type MsgWriter struct {
// contains filtered or unexported fields
}
type SocketOpts ¶ added in v0.1.7
type SocketOpts struct {
URI string
}
func WithURI ¶ added in v0.1.7
func WithURI(uri string) SocketOpts
Click to show internal directories.
Click to hide internal directories.