heimdall

package
v0.0.0-...-5e80f84 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2022 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

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")
)

Functions

func Fetch

func Fetch[T any](ctx context.Context, request *Request) (*T, error)

Fetch returns data from heimdall

func FetchWithRetry

func FetchWithRetry[T any](ctx context.Context, client http.Client, url *url.URL, closeCh chan struct{}) (*T, error)

FetchWithRetry returns data from heimdall with retry

Types

type HeimdallClient

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

func NewHeimdallClient

func NewHeimdallClient(urlString string) *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) 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 Request

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

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"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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