inmemstore

package
v1.8.2 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2022 License: BSD-3-Clause Imports: 4 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

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

Store implements a simple Putter and Getter which can be used to temporarily cache chunks. Currently this is used in the bootstrapping process of new nodes where we sync the postage events from the swarm network.

func New

func New() *Store

func (*Store) Close

func (s *Store) Close() error

func (*Store) Get

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

func (*Store) GetMulti

func (s *Store) GetMulti(_ context.Context, _ storage.ModeGet, _ ...swarm.Address) (ch []swarm.Chunk, err error)

func (*Store) Has

func (s *Store) Has(_ context.Context, _ swarm.Address) (yes bool, err error)

func (*Store) HasMulti

func (s *Store) HasMulti(_ context.Context, _ ...swarm.Address) (yes []bool, err error)

func (*Store) LastPullSubscriptionBinID

func (s *Store) LastPullSubscriptionBinID(_ uint8) (id uint64, err error)

func (*Store) Put

func (s *Store) Put(_ context.Context, _ storage.ModePut, chs ...swarm.Chunk) (exist []bool, err error)

func (*Store) Set

func (s *Store) Set(_ context.Context, _ storage.ModeSet, _ ...swarm.Address) (err error)

func (*Store) SubscribePull

func (s *Store) SubscribePull(_ context.Context, _ uint8, _ uint64, _ uint64) (c <-chan storage.Descriptor, closed <-chan struct{}, stop func())

func (*Store) SubscribePush

func (s *Store) SubscribePush(_ context.Context, _ func([]byte) bool) (c <-chan swarm.Chunk, repeat func(), stop func())

Jump to

Keyboard shortcuts

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