mock

package
v1.11.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2023 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option interface {
	// contains filtered or unexported methods
}

func WithAutoReply

func WithAutoReply() Option

WithAutoReply means that the pull syncer will automatically reply to incoming range requests with a top = from+limit. This is in order to force the requester to request a subsequent range.

func WithCursors

func WithCursors(v []uint64) Option

func WithLateSyncReply

func WithLateSyncReply(r ...SyncReply) Option

func WithLiveSyncBlock

func WithLiveSyncBlock() Option

WithLiveSyncBlock makes the protocol mock block on incoming live sync requests (identified by the math.MaxUint64 `to` field).

func WithLiveSyncReplies

func WithLiveSyncReplies(r ...uint64) Option

func WithSyncError added in v1.10.0

func WithSyncError(err error) Option

type PullSyncMock

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

func NewPullSync

func NewPullSync(opts ...Option) *PullSyncMock

func (*PullSyncMock) CancelRuid

func (p *PullSyncMock) CancelRuid(ctx context.Context, peer swarm.Address, ruid uint32) error

func (*PullSyncMock) Close

func (p *PullSyncMock) Close() error

func (*PullSyncMock) CursorsCalls

func (p *PullSyncMock) CursorsCalls(peer swarm.Address) bool

func (*PullSyncMock) GetCursors

func (p *PullSyncMock) GetCursors(_ context.Context, peer swarm.Address) ([]uint64, error)

func (*PullSyncMock) LiveSyncCalls

func (p *PullSyncMock) LiveSyncCalls(peer swarm.Address) (res []SyncCall)

func (*PullSyncMock) SyncCalls

func (p *PullSyncMock) SyncCalls(peer swarm.Address) (res []SyncCall)

func (*PullSyncMock) SyncInterval

func (p *PullSyncMock) SyncInterval(ctx context.Context, peer swarm.Address, bin uint8, from, to uint64) (topmost uint64, err error)

func (*PullSyncMock) TriggerChange

func (p *PullSyncMock) TriggerChange()

type SyncCall

type SyncCall struct {
	Peer     swarm.Address
	Bin      uint8
	From, To uint64
	Live     bool
}

type SyncReply

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

func NewReply

func NewReply(bin uint8, from, top uint64, block bool) SyncReply

Jump to

Keyboard shortcuts

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