relayer29

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(opts relay29.Options) (relayer.Relay, *relay29.State)

Types

type Relay

type Relay struct {
	NIP11Info  func() nip11.RelayInformationDocument
	RejectFunc func(*nostr.Event) (bool, string)
	// contains filtered or unexported fields
}

func (*Relay) AcceptEvent

func (r *Relay) AcceptEvent(ctx context.Context, ev *nostr.Event) bool

func (*Relay) AddEvent

func (r *Relay) AddEvent(ctx context.Context, ev *nostr.Event) (skipBroadcast bool, writeError error)

func (*Relay) BroadcastEvent

func (r *Relay) BroadcastEvent(ev *nostr.Event)

func (*Relay) GetNIP11InformationDocument

func (r *Relay) GetNIP11InformationDocument() nip11.RelayInformationDocument

func (*Relay) Init

func (r *Relay) Init() error

func (*Relay) Name

func (r *Relay) Name() string

func (*Relay) Storage

func (r *Relay) Storage(ctx context.Context) eventstore.Store

type Store

type Store struct {
	// contains filtered or unexported fields
}

func (*Store) Close

func (s *Store) Close()

func (*Store) DeleteEvent

func (s *Store) DeleteEvent(ctx context.Context, ev *nostr.Event) error

func (*Store) Init

func (s *Store) Init() error

func (*Store) QueryEvents

func (s *Store) QueryEvents(ctx context.Context, filter nostr.Filter) (chan *nostr.Event, error)

func (*Store) SaveEvent

func (s *Store) SaveEvent(ctx context.Context, ev *nostr.Event) error

Jump to

Keyboard shortcuts

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