Documentation ¶
Index ¶
- Variables
- func Fetch[T any](ctx context.Context, request *Request) (*T, error)
- func FetchWithRetry[T any](ctx context.Context, client http.Client, url *url.URL, closeCh chan struct{}, ...) (*T, error)
- func MilestoneRewindPending() bool
- type HeimdallClient
- func (h *HeimdallClient) Close()
- func (h *HeimdallClient) FetchCheckpoint(ctx context.Context, number int64) (*checkpoint.Checkpoint, error)
- func (h *HeimdallClient) FetchCheckpointCount(ctx context.Context) (int64, error)
- func (h *HeimdallClient) FetchLastNoAckMilestone(ctx context.Context) (string, error)
- func (h *HeimdallClient) FetchMilestone(ctx context.Context) (*milestone.Milestone, error)
- func (h *HeimdallClient) FetchMilestoneCount(ctx context.Context) (int64, error)
- func (h *HeimdallClient) FetchMilestoneID(ctx context.Context, milestoneID string) error
- func (h *HeimdallClient) FetchNoAckMilestone(ctx context.Context, milestoneID string) error
- func (h *HeimdallClient) Span(ctx context.Context, spanID uint64) (*span.HeimdallSpan, error)
- func (h *HeimdallClient) StateSyncEvents(ctx context.Context, fromID uint64, to int64) ([]*clerk.EventRecordWithTime, error)
- type HeimdallServer
- type IHeimdallClient
- type Request
- type SpanResponse
- type StateSyncEventsResponse
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrShutdownDetected is returned if a shutdown was detected ErrShutdownDetected = errors.New("shutdown detected") ErrNoResponse = errors.New("got a nil response") ErrNotSuccessfulResponse = errors.New("error while fetching data from Heimdall") ErrNotInRejectedList = errors.New("milestoneID doesn't exist in rejected list") ErrNotInMilestoneList = errors.New("milestoneID doesn't exist in Heimdall") )
Functions ¶
func FetchWithRetry ¶
func FetchWithRetry[T any](ctx context.Context, client http.Client, url *url.URL, closeCh chan struct{}, logger log.Logger) (*T, error)
FetchWithRetry returns data from heimdall with retry
func MilestoneRewindPending ¶
func MilestoneRewindPending() bool
Types ¶
type HeimdallClient ¶
type HeimdallClient struct {
// contains filtered or unexported fields
}
func NewHeimdallClient ¶
func NewHeimdallClient(urlString string, logger log.Logger) *HeimdallClient
func (*HeimdallClient) Close ¶
func (h *HeimdallClient) Close()
Close sends a signal to stop the running process
func (*HeimdallClient) FetchCheckpoint ¶
func (h *HeimdallClient) FetchCheckpoint(ctx context.Context, number int64) (*checkpoint.Checkpoint, error)
FetchCheckpoint fetches the checkpoint from heimdall
func (*HeimdallClient) FetchCheckpointCount ¶
func (h *HeimdallClient) FetchCheckpointCount(ctx context.Context) (int64, error)
FetchCheckpointCount fetches the checkpoint count from heimdall
func (*HeimdallClient) FetchLastNoAckMilestone ¶
func (h *HeimdallClient) FetchLastNoAckMilestone(ctx context.Context) (string, error)
FetchLastNoAckMilestone fetches the last no-ack-milestone from heimdall
func (*HeimdallClient) FetchMilestone ¶
FetchMilestone fetches the checkpoint from heimdall
func (*HeimdallClient) FetchMilestoneCount ¶
func (h *HeimdallClient) FetchMilestoneCount(ctx context.Context) (int64, error)
FetchMilestoneCount fetches the milestone count from heimdall
func (*HeimdallClient) FetchMilestoneID ¶
func (h *HeimdallClient) FetchMilestoneID(ctx context.Context, milestoneID string) error
FetchMilestoneID fetches the bool result from Heimdal whether the ID corresponding to the given milestone is in process in Heimdall
func (*HeimdallClient) FetchNoAckMilestone ¶
func (h *HeimdallClient) FetchNoAckMilestone(ctx context.Context, milestoneID string) error
FetchNoAckMilestone fetches the last no-ack-milestone from heimdall
func (*HeimdallClient) Span ¶
func (h *HeimdallClient) Span(ctx context.Context, spanID uint64) (*span.HeimdallSpan, error)
func (*HeimdallClient) StateSyncEvents ¶
func (h *HeimdallClient) StateSyncEvents(ctx context.Context, fromID uint64, to int64) ([]*clerk.EventRecordWithTime, error)
type HeimdallServer ¶
type HeimdallServer interface { StateSyncEvents(ctx context.Context, fromID uint64, to int64, limit int) (uint64, []*clerk.EventRecordWithTime, error) Span(ctx context.Context, spanID uint64) (*span.HeimdallSpan, error) FetchCheckpoint(ctx context.Context, number int64) (*checkpoint.Checkpoint, error) FetchCheckpointCount(ctx context.Context) (int64, error) FetchMilestone(ctx context.Context) (*milestone.Milestone, error) FetchMilestoneCount(ctx context.Context) (int64, error) FetchNoAckMilestone(ctx context.Context, milestoneID string) error FetchLastNoAckMilestone(ctx context.Context) (string, error) FetchMilestoneID(ctx context.Context, milestoneID string) error Close() }
type IHeimdallClient ¶
type IHeimdallClient interface { StateSyncEvents(ctx context.Context, fromID uint64, to int64) ([]*clerk.EventRecordWithTime, error) Span(ctx context.Context, spanID uint64) (*span.HeimdallSpan, error) FetchCheckpoint(ctx context.Context, number int64) (*checkpoint.Checkpoint, error) FetchCheckpointCount(ctx context.Context) (int64, error) FetchMilestone(ctx context.Context) (*milestone.Milestone, error) FetchMilestoneCount(ctx context.Context) (int64, error) FetchNoAckMilestone(ctx context.Context, milestoneID string) error //Fetch the bool value whether milestone corresponding to the given id failed in the Heimdall FetchLastNoAckMilestone(ctx context.Context) (string, error) //Fetch latest failed milestone id FetchMilestoneID(ctx context.Context, milestoneID string) error //Fetch the bool value whether milestone corresponding to the given id is in process in Heimdall Close() }
type SpanResponse ¶
type SpanResponse struct { Height string `json:"height"` Result span.HeimdallSpan `json:"result"` }
type StateSyncEventsResponse ¶
type StateSyncEventsResponse struct { Height string `json:"height"` Result []*clerk.EventRecordWithTime `json:"result"` }
Click to show internal directories.
Click to hide internal directories.