mock

package
v0.6.10 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2021 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockStorer

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

func NewStorer

func NewStorer(opts ...Option) *MockStorer

func (*MockStorer) Close

func (m *MockStorer) Close() error

func (*MockStorer) Get

func (m *MockStorer) Get(_ context.Context, _ storage.ModeGet, addr swarm.Address) (ch swarm.Chunk, err error)

func (*MockStorer) GetModePut

func (m *MockStorer) GetModePut(addr swarm.Address) (mode storage.ModePut)

func (*MockStorer) GetModeSet

func (m *MockStorer) GetModeSet(addr swarm.Address) (mode storage.ModeSet)

func (*MockStorer) GetMulti

func (m *MockStorer) GetMulti(ctx context.Context, mode storage.ModeGet, addrs ...swarm.Address) (ch []swarm.Chunk, err error)

func (*MockStorer) Has

func (m *MockStorer) Has(ctx context.Context, addr swarm.Address) (yes bool, err error)

func (*MockStorer) HasMulti

func (m *MockStorer) HasMulti(ctx context.Context, addrs ...swarm.Address) (yes []bool, err error)

func (*MockStorer) LastPullSubscriptionBinID

func (m *MockStorer) LastPullSubscriptionBinID(bin uint8) (id uint64, err error)

func (*MockStorer) MorePull

func (m *MockStorer) MorePull(d ...storage.Descriptor)

func (*MockStorer) Put

func (m *MockStorer) Put(ctx context.Context, mode storage.ModePut, chs ...swarm.Chunk) (exist []bool, err error)

func (*MockStorer) Set

func (m *MockStorer) Set(ctx context.Context, mode storage.ModeSet, addrs ...swarm.Address) (err error)

func (*MockStorer) SubscribePull

func (m *MockStorer) SubscribePull(ctx context.Context, bin uint8, since, until uint64) (<-chan storage.Descriptor, <-chan struct{}, func())

func (*MockStorer) SubscribePullCalls

func (m *MockStorer) SubscribePullCalls() int

func (*MockStorer) SubscribePush

func (m *MockStorer) SubscribePush(ctx context.Context) (c <-chan swarm.Chunk, stop func())

type Option

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

func WithBaseAddress

func WithBaseAddress(a swarm.Address) Option

func WithPartialInterval

func WithPartialInterval(v bool) Option

func WithSubscribePullChunks

func WithSubscribePullChunks(chs ...storage.Descriptor) Option

Jump to

Keyboard shortcuts

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