Help us shape the future of Go! Take the 2026 Go Developer Survey

getter

package
v1.14.2 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2025 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Getter

type Getter interface {
	// Get retrieves blocks by their IDs
	Get(
		ctx context.Context,
		nodeID ids.NodeID,
		requestID uint32,
		blockIDs set.Set[ids.ID],
	) error

	// GetAncestors retrieves ancestors of a block
	GetAncestors(
		ctx context.Context,
		nodeID ids.NodeID,
		requestID uint32,
		blockID ids.ID,
	) error
}

Getter defines the interface for fetching blocks

type Manager

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

Manager manages block fetching operations

func NewManager

func NewManager(getter Getter, timeout time.Duration) *Manager

NewManager creates a new getter manager

func (*Manager) Get

func (m *Manager) Get(ctx context.Context, nodeID ids.NodeID, blockIDs set.Set[ids.ID]) error

Get initiates a block fetch request

func (*Manager) GetAncestors

func (m *Manager) GetAncestors(ctx context.Context, nodeID ids.NodeID, blockID ids.ID) error

GetAncestors initiates an ancestor fetch request

func (*Manager) OnResponse

func (m *Manager) OnResponse(reqID uint32)

OnResponse handles responses to fetch requests

func (*Manager) Outstanding

func (m *Manager) Outstanding() int

Outstanding returns the number of outstanding requests

func (*Manager) TimeoutPending

func (m *Manager) TimeoutPending()

TimeoutPending removes timed out requests

Jump to

Keyboard shortcuts

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