Documentation
¶
Index ¶
- func CancelSub(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, conn *websocket.Conn, id event.ID, ...) (event.Event, bool)
- func ListenForEventsOnSub(ctx context.Context, t *testing.T, conn *websocket.Conn, ...) <-chan event.Event
- func NewConnection(t *testing.T) *nostr.Relay
- func Publish(ctx context.Context, t require.TestingT, e event.Event, conn *websocket.Conn)
- func ReadEvent(ctx context.Context, t *testing.T, conn *websocket.Conn) (messages.SubscriptionID, event.Event, error)
- func RequestSub(ctx context.Context, t *testing.T, conn *websocket.Conn, ...) messages.SubscriptionID
- func SetDefaultURI(uri string)
- type Closer
- type EventOptions
- type PrivKey
- type PubKey
- type SocketOpts
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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 RequestSub ¶
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 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.