{"modulePath":"github.com/ethersphere/bee","version":"v1.16.1","isLatest":false,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package mock\n\n## Types\n\n```go\ntype Option interface {\n\t// contains filtered or unexported methods\n}\n```\n\n```go\nfunc WithChunks(chs ...swarm.Chunk) Option\n```\nWithChunks mocks the set of chunks that the store is aware of (used in Get and Has calls).\n\n```go\nfunc WithCursors(c []uint64) Option\n```\n\n```go\nfunc WithCursorsErr(e error) Option\n```\n\n```go\nfunc WithEvilChunk(addr swarm.Address, ch swarm.Chunk) Option\n```\nWithEvilChunk allows to inject a malicious chunk (request a certain address of a chunk, but get another), in order to mock unsolicited chunk delivery.\n\n```go\nfunc WithIntervalsResp(addrs []swarm.Address, top uint64, err error) Option\n```\nWithIntervalsResp mocks a desired response when calling IntervalChunks method. Different possible responses for subsequent responses in multi-call scenarios are possible (i.e. first call yields a,b,c, second call yields d,e,f). Mock maintains state of current call using chunksCalls counter.\n\n```go\ntype PullStorage struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewPullStorage(opts ...Option) *PullStorage\n```\nNewPullStorage returns a new PullStorage mock.\n\n```go\nfunc (s *PullStorage) Cursors(ctx context.Context) (curs []uint64, err error)\n```\n\n```go\nfunc (s *PullStorage) Get(_ context.Context, _ storage.ModeGet, addrs ...swarm.Address) (chs []swarm.Chunk, err error)\n```\nGet chunks.\n\n```go\nfunc (s *PullStorage) Has(_ context.Context, addr swarm.Address) (bool, error)\n```\nHas chunks.\n\n```go\nfunc (s *PullStorage) IntervalChunks(_ context.Context, bin uint8, from, to uint64, limit int) (chunks []swarm.Address, topmost uint64, err error)\n```\nIntervalChunks returns a set of chunk in a requested interval.\n\n```go\nfunc (s *PullStorage) Put(_ context.Context, _ storage.ModePut, chs ...swarm.Chunk) error\n```\nPut chunks.\n\n```go\nfunc (s *PullStorage) PutCalls() int\n```\nPutCalls returns the amount of times Put was called.\n\n```go\nfunc (s *PullStorage) Set(ctx context.Context, mode storage.ModeSet, addrs ...swarm.Address) error\n```\nSet chunks.\n\n```go\nfunc (s *PullStorage) SetCalls() int\n```\nSetCalls returns the amount of times Set was called.\n\n","path":"github.com/ethersphere/bee/pkg/pullsync/pullstorage/mock","name":"mock","synopsis":"","isRedistributable":true}
