Documentation ¶
Index ¶
- type DB
- type DBRetrier
- func (db DBRetrier) CountCandidates(ctx context.Context) (uint, error)
- func (db DBRetrier) CountHandshakeCandidates(ctx context.Context) (uint, error)
- func (db DBRetrier) CountPingErrors(ctx context.Context, id NodeID) (*uint, error)
- func (db DBRetrier) DeleteHandshakeErrors(ctx context.Context, id NodeID) error
- func (db DBRetrier) FindClientID(ctx context.Context, id NodeID) (*string, error)
- func (db DBRetrier) FindHandshakeLastErrors(ctx context.Context, id NodeID, limit uint) ([]HandshakeError, error)
- func (db DBRetrier) FindHandshakeRetryTime(ctx context.Context, id NodeID) (*time.Time, error)
- func (db DBRetrier) FindNeighborBucketKeys(ctx context.Context, id NodeID) ([]string, error)
- func (db DBRetrier) FindNodeAddr(ctx context.Context, id NodeID) (*NodeAddr, error)
- func (db DBRetrier) FindSentryCandidatesLastEventTime(ctx context.Context) (*time.Time, error)
- func (db DBRetrier) InsertHandshakeError(ctx context.Context, id NodeID, handshakeErr string) error
- func (db DBRetrier) IsConflictError(err error) bool
- func (db DBRetrier) ResetPingError(ctx context.Context, id NodeID) error
- func (db DBRetrier) TakeCandidates(ctx context.Context, limit uint) ([]NodeID, error)
- func (db DBRetrier) TakeHandshakeCandidates(ctx context.Context, limit uint) ([]NodeID, error)
- func (db DBRetrier) UpdateClientID(ctx context.Context, id NodeID, clientID string) error
- func (db DBRetrier) UpdateCrawlRetryTime(ctx context.Context, id NodeID, retryTime time.Time) error
- func (db DBRetrier) UpdateEthVersion(ctx context.Context, id NodeID, ethVersion uint) error
- func (db DBRetrier) UpdateForkCompatibility(ctx context.Context, id NodeID, isCompatFork bool) error
- func (db DBRetrier) UpdateHandshakeRetryTime(ctx context.Context, id NodeID, retryTime time.Time) error
- func (db DBRetrier) UpdateHandshakeTransientError(ctx context.Context, id NodeID, hasTransientErr bool) error
- func (db DBRetrier) UpdateNeighborBucketKeys(ctx context.Context, id NodeID, keys []string) error
- func (db DBRetrier) UpdateNetworkID(ctx context.Context, id NodeID, networkID uint) error
- func (db DBRetrier) UpdatePingError(ctx context.Context, id NodeID) error
- func (db DBRetrier) UpdateSentryCandidatesLastEventTime(ctx context.Context, value time.Time) error
- func (db DBRetrier) UpsertNodeAddr(ctx context.Context, id NodeID, addr NodeAddr) error
- type DBSQLite
- func (db *DBSQLite) Close() error
- func (db *DBSQLite) CountCandidates(ctx context.Context) (uint, error)
- func (db *DBSQLite) CountClients(ctx context.Context, clientIDPrefix string, maxPingTries uint, networkID uint) (uint, error)
- func (db *DBSQLite) CountClientsWithHandshakeTransientError(ctx context.Context, clientIDPrefix string, maxPingTries uint) (uint, error)
- func (db *DBSQLite) CountClientsWithNetworkID(ctx context.Context, clientIDPrefix string, maxPingTries uint) (uint, error)
- func (db *DBSQLite) CountHandshakeCandidates(ctx context.Context) (uint, error)
- func (db *DBSQLite) CountIPs(ctx context.Context, maxPingTries uint, networkID uint) (uint, error)
- func (db *DBSQLite) CountNodes(ctx context.Context, maxPingTries uint, networkID uint) (uint, error)
- func (db *DBSQLite) CountPingErrors(ctx context.Context, id NodeID) (*uint, error)
- func (db *DBSQLite) DeleteHandshakeErrors(ctx context.Context, id NodeID) error
- func (db *DBSQLite) EnumerateClientIDs(ctx context.Context, maxPingTries uint, networkID uint, ...) error
- func (db *DBSQLite) FindCandidates(ctx context.Context, limit uint) ([]NodeID, error)
- func (db *DBSQLite) FindClientID(ctx context.Context, id NodeID) (*string, error)
- func (db *DBSQLite) FindHandshakeCandidates(ctx context.Context, limit uint) ([]NodeID, error)
- func (db *DBSQLite) FindHandshakeLastErrors(ctx context.Context, id NodeID, limit uint) ([]HandshakeError, error)
- func (db *DBSQLite) FindHandshakeRetryTime(ctx context.Context, id NodeID) (*time.Time, error)
- func (db *DBSQLite) FindNeighborBucketKeys(ctx context.Context, id NodeID) ([]string, error)
- func (db *DBSQLite) FindNodeAddr(ctx context.Context, id NodeID) (*NodeAddr, error)
- func (db *DBSQLite) FindSentryCandidatesLastEventTime(ctx context.Context) (*time.Time, error)
- func (db *DBSQLite) InsertHandshakeError(ctx context.Context, id NodeID, handshakeErr string) error
- func (db *DBSQLite) IsConflictError(err error) bool
- func (db *DBSQLite) MarkTakenHandshakeCandidates(ctx context.Context, ids []NodeID) error
- func (db *DBSQLite) MarkTakenNodes(ctx context.Context, ids []NodeID) error
- func (db *DBSQLite) ResetPingError(ctx context.Context, id NodeID) error
- func (db *DBSQLite) TakeCandidates(ctx context.Context, limit uint) ([]NodeID, error)
- func (db *DBSQLite) TakeHandshakeCandidates(ctx context.Context, limit uint) ([]NodeID, error)
- func (db *DBSQLite) UpdateClientID(ctx context.Context, id NodeID, clientID string) error
- func (db *DBSQLite) UpdateCrawlRetryTime(ctx context.Context, id NodeID, retryTime time.Time) error
- func (db *DBSQLite) UpdateEthVersion(ctx context.Context, id NodeID, ethVersion uint) error
- func (db *DBSQLite) UpdateForkCompatibility(ctx context.Context, id NodeID, isCompatFork bool) error
- func (db *DBSQLite) UpdateHandshakeRetryTime(ctx context.Context, id NodeID, retryTime time.Time) error
- func (db *DBSQLite) UpdateHandshakeTransientError(ctx context.Context, id NodeID, hasTransientErr bool) error
- func (db *DBSQLite) UpdateNeighborBucketKeys(ctx context.Context, id NodeID, keys []string) error
- func (db *DBSQLite) UpdateNetworkID(ctx context.Context, id NodeID, networkID uint) error
- func (db *DBSQLite) UpdatePingError(ctx context.Context, id NodeID) error
- func (db *DBSQLite) UpdateSentryCandidatesLastEventTime(ctx context.Context, value time.Time) error
- func (db *DBSQLite) UpsertNodeAddr(ctx context.Context, id NodeID, addr NodeAddr) error
- type HandshakeError
- type NodeAddr
- type NodeAddr1
- type NodeID
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DB ¶
type DB interface { io.Closer UpsertNodeAddr(ctx context.Context, id NodeID, addr NodeAddr) error FindNodeAddr(ctx context.Context, id NodeID) (*NodeAddr, error) ResetPingError(ctx context.Context, id NodeID) error UpdatePingError(ctx context.Context, id NodeID) error CountPingErrors(ctx context.Context, id NodeID) (*uint, error) UpdateClientID(ctx context.Context, id NodeID, clientID string) error FindClientID(ctx context.Context, id NodeID) (*string, error) UpdateNetworkID(ctx context.Context, id NodeID, networkID uint) error UpdateEthVersion(ctx context.Context, id NodeID, ethVersion uint) error UpdateHandshakeTransientError(ctx context.Context, id NodeID, hasTransientErr bool) error InsertHandshakeError(ctx context.Context, id NodeID, handshakeErr string) error DeleteHandshakeErrors(ctx context.Context, id NodeID) error FindHandshakeLastErrors(ctx context.Context, id NodeID, limit uint) ([]HandshakeError, error) UpdateHandshakeRetryTime(ctx context.Context, id NodeID, retryTime time.Time) error FindHandshakeRetryTime(ctx context.Context, id NodeID) (*time.Time, error) CountHandshakeCandidates(ctx context.Context) (uint, error) FindHandshakeCandidates(ctx context.Context, limit uint) ([]NodeID, error) MarkTakenHandshakeCandidates(ctx context.Context, nodes []NodeID) error // TakeHandshakeCandidates runs FindHandshakeCandidates + MarkTakenHandshakeCandidates in a transaction. TakeHandshakeCandidates(ctx context.Context, limit uint) ([]NodeID, error) UpdateForkCompatibility(ctx context.Context, id NodeID, isCompatFork bool) error UpdateNeighborBucketKeys(ctx context.Context, id NodeID, keys []string) error FindNeighborBucketKeys(ctx context.Context, id NodeID) ([]string, error) UpdateSentryCandidatesLastEventTime(ctx context.Context, value time.Time) error FindSentryCandidatesLastEventTime(ctx context.Context) (*time.Time, error) UpdateCrawlRetryTime(ctx context.Context, id NodeID, retryTime time.Time) error CountCandidates(ctx context.Context) (uint, error) FindCandidates(ctx context.Context, limit uint) ([]NodeID, error) MarkTakenNodes(ctx context.Context, nodes []NodeID) error // TakeCandidates runs FindCandidates + MarkTakenNodes in a transaction. TakeCandidates(ctx context.Context, limit uint) ([]NodeID, error) IsConflictError(err error) bool CountNodes(ctx context.Context, maxPingTries uint, networkID uint) (uint, error) CountIPs(ctx context.Context, maxPingTries uint, networkID uint) (uint, error) CountClients(ctx context.Context, clientIDPrefix string, maxPingTries uint, networkID uint) (uint, error) CountClientsWithNetworkID(ctx context.Context, clientIDPrefix string, maxPingTries uint) (uint, error) CountClientsWithHandshakeTransientError(ctx context.Context, clientIDPrefix string, maxPingTries uint) (uint, error) EnumerateClientIDs(ctx context.Context, maxPingTries uint, networkID uint, enumFunc func(clientID *string)) error }
type DBRetrier ¶
type DBRetrier struct {
// contains filtered or unexported fields
}
func NewDBRetrier ¶
func (DBRetrier) CountCandidates ¶
func (DBRetrier) CountHandshakeCandidates ¶
func (DBRetrier) CountPingErrors ¶
func (DBRetrier) DeleteHandshakeErrors ¶
func (DBRetrier) FindClientID ¶
func (DBRetrier) FindHandshakeLastErrors ¶
func (DBRetrier) FindHandshakeRetryTime ¶
func (DBRetrier) FindNeighborBucketKeys ¶
func (DBRetrier) FindNodeAddr ¶
func (DBRetrier) FindSentryCandidatesLastEventTime ¶
func (DBRetrier) InsertHandshakeError ¶
func (DBRetrier) IsConflictError ¶
func (DBRetrier) ResetPingError ¶
func (DBRetrier) TakeCandidates ¶
func (DBRetrier) TakeHandshakeCandidates ¶
func (DBRetrier) UpdateClientID ¶
func (DBRetrier) UpdateCrawlRetryTime ¶
func (DBRetrier) UpdateEthVersion ¶
func (DBRetrier) UpdateForkCompatibility ¶
func (DBRetrier) UpdateHandshakeRetryTime ¶
func (DBRetrier) UpdateHandshakeTransientError ¶
func (DBRetrier) UpdateNeighborBucketKeys ¶
func (DBRetrier) UpdateNetworkID ¶
func (DBRetrier) UpdatePingError ¶
func (DBRetrier) UpdateSentryCandidatesLastEventTime ¶
type DBSQLite ¶
type DBSQLite struct {
// contains filtered or unexported fields
}
func NewDBSQLite ¶
func (*DBSQLite) CountCandidates ¶
func (*DBSQLite) CountClients ¶
func (*DBSQLite) CountClientsWithHandshakeTransientError ¶
func (*DBSQLite) CountClientsWithNetworkID ¶
func (*DBSQLite) CountHandshakeCandidates ¶
func (*DBSQLite) CountNodes ¶
func (*DBSQLite) CountPingErrors ¶
func (*DBSQLite) DeleteHandshakeErrors ¶
func (*DBSQLite) EnumerateClientIDs ¶
func (*DBSQLite) FindCandidates ¶
func (*DBSQLite) FindClientID ¶
func (*DBSQLite) FindHandshakeCandidates ¶
func (*DBSQLite) FindHandshakeLastErrors ¶
func (*DBSQLite) FindHandshakeRetryTime ¶
func (*DBSQLite) FindNeighborBucketKeys ¶
func (*DBSQLite) FindNodeAddr ¶
func (*DBSQLite) FindSentryCandidatesLastEventTime ¶
func (*DBSQLite) InsertHandshakeError ¶
func (*DBSQLite) IsConflictError ¶
func (*DBSQLite) MarkTakenHandshakeCandidates ¶
func (*DBSQLite) MarkTakenNodes ¶
func (*DBSQLite) ResetPingError ¶
func (*DBSQLite) TakeCandidates ¶
func (*DBSQLite) TakeHandshakeCandidates ¶
func (*DBSQLite) UpdateClientID ¶
func (*DBSQLite) UpdateCrawlRetryTime ¶
func (*DBSQLite) UpdateEthVersion ¶
func (*DBSQLite) UpdateForkCompatibility ¶
func (*DBSQLite) UpdateHandshakeRetryTime ¶
func (*DBSQLite) UpdateHandshakeTransientError ¶
func (*DBSQLite) UpdateNeighborBucketKeys ¶
func (*DBSQLite) UpdateNetworkID ¶
func (*DBSQLite) UpdatePingError ¶
func (*DBSQLite) UpdateSentryCandidatesLastEventTime ¶
type HandshakeError ¶
Click to show internal directories.
Click to hide internal directories.