spider

package
v0.19.3 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2025 License: Unlicense Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// BatchSize is the number of pubkeys per subscription batch
	BatchSize = 20
	// CatchupWindow is the extra time added to disconnection periods for catch-up
	CatchupWindow = 30 * time.Minute
	// ReconnectDelay is the delay between reconnection attempts
	ReconnectDelay = 5 * time.Second
	// MaxReconnectDelay is the maximum delay between reconnection attempts
	MaxReconnectDelay = 5 * time.Minute
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BatchSubscription added in v0.17.14

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

BatchSubscription represents a subscription for a batch of pubkeys

type DisconnectionPeriod added in v0.17.14

type DisconnectionPeriod struct {
	Start time.Time
	End   time.Time
}

DisconnectionPeriod tracks when a subscription was disconnected

type RelayConnection added in v0.17.14

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

RelayConnection manages a single relay connection and its subscriptions

type Spider

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

Spider manages connections to admin relays and syncs events for followed pubkeys

func New

func New(ctx context.Context, db *database.D, pub publisher.I, mode string) (s *Spider, err error)

New creates a new Spider instance

func (*Spider) SetCallbacks added in v0.17.14

func (s *Spider) SetCallbacks(getAdminRelays func() []string, getFollowList func() [][]byte)

SetCallbacks sets the callback functions for getting updated admin relays and follow lists

func (*Spider) Start

func (s *Spider) Start() (err error)

Start begins the spider operation

func (*Spider) Stop

func (s *Spider) Stop()

Stop stops the spider operation

Source Files

  • spider.go

Jump to

Keyboard shortcuts

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