repo

package
v0.0.0-...-3e92949 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2025 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = fmt.Errorf("not found: %w", sql.ErrNoRows)

Functions

This section is empty.

Types

type NodesRepo

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

func New

func New(rdb *sql.DB, wdb *sql.DB) *NodesRepo

func (*NodesRepo) GetNodeByPublicKey

func (r *NodesRepo) GetNodeByPublicKey(ctx context.Context, pk *dht.PublicKey) (*models.Node, error)

func (*NodesRepo) GetNodeCount

func (r *NodesRepo) GetNodeCount(ctx context.Context) (int64, error)

func (*NodesRepo) GetNodesWithStaleBootstrapInfo

func (r *NodesRepo) GetNodesWithStaleBootstrapInfo(ctx context.Context) ([]*models.Node, error)

func (*NodesRepo) GetResponsiveDHTNodes

func (r *NodesRepo) GetResponsiveDHTNodes(ctx context.Context) ([]*dht.Node, error)

func (*NodesRepo) GetUnresponsiveDHTNodes

func (r *NodesRepo) GetUnresponsiveDHTNodes(ctx context.Context, retryDelay time.Duration) ([]*dht.Node, error)

func (*NodesRepo) HasNodeByPublicKey

func (r *NodesRepo) HasNodeByPublicKey(ctx context.Context, pk *dht.PublicKey) (bool, error)

func (*NodesRepo) PingDHTNode

func (r *NodesRepo) PingDHTNode(ctx context.Context, node *dht.Node) error

func (*NodesRepo) PongDHTNode

func (r *NodesRepo) PongDHTNode(ctx context.Context, node *dht.Node) error

func (*NodesRepo) TrackDHTNode

func (r *NodesRepo) TrackDHTNode(ctx context.Context, node *dht.Node) (*models.Node, error)

func (*NodesRepo) UpdateNodeInfo

func (r *NodesRepo) UpdateNodeInfo(ctx context.Context, addr *net.UDPAddr, motd string, version uint32) error

func (*NodesRepo) UpdateNodeInfoRequestTime

func (r *NodesRepo) UpdateNodeInfoRequestTime(ctx context.Context, addrReqTimes map[int64]time.Time) error

Jump to

Keyboard shortcuts

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