help

package
v0.1.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 4, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CancelSub

func CancelSub(ctx context.Context, t *testing.T, subID messages.SubscriptionID, conn *websocket.Conn)

func ListenForEventsOnSub

func ListenForEventsOnSub(
	ctx context.Context, t *testing.T, conn *websocket.Conn, sub messages.SubscriptionID,
) <-chan event.Event

func NewConnection

func NewConnection(t *testing.T) *nostr.Relay

func NewKeyPair

func NewKeyPair(t *testing.T) (PrivKey, PubKey)

func NewSignedEvent

func NewSignedEvent(t *testing.T, opts EventOptions) nostr.Event

func Publish

func Publish(ctx context.Context, t *testing.T, e event.Event, conn *websocket.Conn)

func RequestSub

func RequestSub(ctx context.Context, t *testing.T, conn *websocket.Conn, filters ...messages.Filter) messages.SubscriptionID

func ToEvent

func ToEvent(ne nostr.Event) event.Event

Types

type Closer

type Closer func()

func NewSocket

func NewSocket(ctx context.Context, t *testing.T) (*websocket.Conn, Closer)

type EventOptions

type EventOptions struct {
	PrivKey   PrivKey
	CreatedAt time.Time
	Kind      int
	Tags      nostr.Tags
	Content   string
}

type PrivKey

type PrivKey string

func (PrivKey) String

func (priv PrivKey) String() string

type PubKey

type PubKey string

func (PubKey) String

func (priv PubKey) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL