shared

package
v1.28.3 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2023 License: Apache-2.0, MIT Imports: 18 Imported by: 48

Documentation

Index

Constants

View Source
const CloseDataTransferTimeout = 30 * time.Second

When we close the data transfer, we also send a cancel message to the peer. CloseDataTransferTimeout is the amount of time to wait for the close to complete before giving up.

Variables

This section is empty.

Functions

func AllSelector deprecated added in v0.2.1

func AllSelector() datamodel.Node

Deprecated: AllSelector is a compatibility alias for an entire DAG non-matching-selector. Use github.com/ipld/go-ipld-prime/traversal/selector/parse.CommonSelector_ExploreAllRecursively instead.

func IsCtxDone added in v1.2.5

func IsCtxDone(err error) bool

func MoveKey added in v0.7.0

func MoveKey(ds datastore.Datastore, old string, new string) error

MoveKey moves a key in a data store

func NewInflatorReader added in v1.14.0

func NewInflatorReader(readSeeker io.ReadSeeker, payloadSize uint64, targetSize abi.UnpaddedPieceSize) (*inflatorReader, error)

func ReadyDispatcher added in v0.7.0

func ReadyDispatcher(evt pubsub.Event, fn pubsub.SubscriberFn) error

ReadyDispatcher is just an pubsub dispatcher where the callback is ReadyFunc

Types

type ReadSeekStarter added in v1.14.0

type ReadSeekStarter interface {
	io.Reader
	SeekStart() error
}

ReadSeekStarter implements io.Reader and allows the caller to seek to the start of the reader

type ReadyFunc added in v0.7.0

type ReadyFunc func(error)

ReadyFunc is function that gets called once when an event is ready

type ReadyManager added in v1.0.11

type ReadyManager struct {
	Stop context.CancelFunc
	// contains filtered or unexported fields
}

ReadyManager managers listeners for a ready event

func NewReadyManager added in v1.0.11

func NewReadyManager() *ReadyManager

func (*ReadyManager) AwaitReady added in v1.0.11

func (m *ReadyManager) AwaitReady() error

AwaitReady blocks until the ready event fires. Returns immediately if the event already fired.

func (*ReadyManager) FireReady added in v1.0.11

func (m *ReadyManager) FireReady(err error) error

FireReady is called when the ready event occurs

func (*ReadyManager) OnReady added in v1.0.11

func (m *ReadyManager) OnReady(ready ReadyFunc)

OnReady registers a listener for the ready event. If the event has already been fired, the callback is immediately called back (in a go-routine).

type RetryStream added in v1.1.0

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

func NewRetryStream added in v1.1.0

func NewRetryStream(opener StreamOpener, options ...RetryStreamOption) *RetryStream

func (*RetryStream) OpenStream added in v1.1.0

func (impl *RetryStream) OpenStream(ctx context.Context, id peer.ID, protocols []protocol.ID) (network.Stream, error)

func (*RetryStream) SetOptions added in v1.1.0

func (impl *RetryStream) SetOptions(options ...RetryStreamOption)

type RetryStreamOption added in v1.1.0

type RetryStreamOption func(*RetryStream)

func RetryParameters added in v1.1.0

func RetryParameters(minDuration time.Duration, maxDuration time.Duration, attempts float64, backoffFactor float64) RetryStreamOption

RetryParameters changes the default parameters around connection reopening

type StreamOpener added in v1.1.0

type StreamOpener interface {
	NewStream(ctx context.Context, p peer.ID, pids ...protocol.ID) (network.Stream, error)
}

type TimeCounter added in v1.2.5

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

timeCounter is used to generate a monotonically increasing sequence. It starts at the current time, then increments on each call to next.

func NewTimeCounter added in v1.2.5

func NewTimeCounter() *TimeCounter

func (*TimeCounter) Next added in v1.2.5

func (tc *TimeCounter) Next() uint64

type TipSetToken

type TipSetToken []byte

TipSetToken is the implementation-nonspecific identity for a tipset.

type Unsubscribe

type Unsubscribe func()

Unsubscribe is a function that gets called to unsubscribe from (storage|retrieval)market events

Jump to

Keyboard shortcuts

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