store

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: May 31, 2022 License: Apache-2.0, MIT Imports: 10 Imported by: 1

Documentation

Index

Constants

View Source
const DefaultBurstRate = 4 * 1024 * 1024

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

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

func OpenStore

func OpenStore(path string, primary primary.PrimaryStorage, indexSizeBits uint8, syncInterval time.Duration, burstRate types.Work, gcInterval time.Duration) (*Store, error)

func (*Store) Close

func (s *Store) Close() error

Close stops store goroutines and calls Close on the index, primary, and freelist. This flushes any outstanding work and buffered data to their files.

func (*Store) Err

func (s *Store) Err() error

func (*Store) Flush

func (s *Store) Flush()

Flush writes outstanding work and buffered data to the primary, index, and freelist files. It then syncs these files to permanent storage.

func (*Store) Get

func (s *Store) Get(key []byte) ([]byte, bool, error)

func (*Store) GetSize

func (s *Store) GetSize(key []byte) (types.Size, bool, error)

func (*Store) Has

func (s *Store) Has(key []byte) (bool, error)

func (*Store) IndexStorageSize added in v0.1.0

func (s *Store) IndexStorageSize() (int64, error)

IndexStorageSize returns the storage used by the index files. This includes the `.info` file and the `.free` file and does not include primary storage.

func (*Store) Put

func (s *Store) Put(key []byte, value []byte) error

func (*Store) Remove

func (s *Store) Remove(key []byte) (bool, error)

func (*Store) Start

func (s *Store) Start()

Directories

Path Synopsis
cid

Jump to

Keyboard shortcuts

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