local

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewExchange

func NewExchange[H header.Header[H]](store header.Store[H]) header.Exchange[H]

NewExchange creates a new local Exchange.

Types

type Exchange

type Exchange[H header.Header[H]] struct {
	// contains filtered or unexported fields
}

Exchange is a simple Exchange that reads Headers from Store without any networking.

func (*Exchange[H]) Get

func (l *Exchange[H]) Get(ctx context.Context, hash header.Hash) (H, error)

func (*Exchange[H]) GetByHeight

func (l *Exchange[H]) GetByHeight(ctx context.Context, height uint64) (H, error)

func (*Exchange[H]) GetRangeByHeight

func (l *Exchange[H]) GetRangeByHeight(ctx context.Context, from H, to uint64,
) ([]H, error)

func (*Exchange[H]) Head

func (l *Exchange[H]) Head(ctx context.Context, _ ...header.HeadOption[H]) (H, error)

func (*Exchange[H]) Start

func (l *Exchange[H]) Start(context.Context) error

func (*Exchange[H]) Stop

func (l *Exchange[H]) Stop(context.Context) error

Jump to

Keyboard shortcuts

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