index

package
v0.0.0-...-a387ffb Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0, Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend interface {
	Flush(map[string]types.NamedIndices) error
	FlushAccounts([]string) error
	Read(account string) (types.NamedIndices, error)
	ReadAccounts() ([]string, error)
	FlushTransactions(map[string]*types.TrieIndex) error
	ReadTransactions(prefix string) (*types.TrieIndex, error)
}

TODO: Use a more standardized filesystem-style backend, so we can re-use code

type FileBackend

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

func NewFileBackend

func NewFileBackend(dir string, parallel uint32) (*FileBackend, error)

NewFileBackend connects to indices stored at `dir`, creating the directory if one doesn't exist, and uses `parallel` to control how many workers to use when flushing to disk.

func (*FileBackend) Flush

func (s *FileBackend) Flush(indexes map[string]types.NamedIndices) error

func (*FileBackend) FlushAccounts

func (s *FileBackend) FlushAccounts(accounts []string) error

func (*FileBackend) FlushTransactions

func (s *FileBackend) FlushTransactions(indexes map[string]*types.TrieIndex) error

func (*FileBackend) Read

func (s *FileBackend) Read(account string) (types.NamedIndices, error)

func (*FileBackend) ReadAccounts

func (s *FileBackend) ReadAccounts() ([]string, error)

func (*FileBackend) ReadTransactions

func (s *FileBackend) ReadTransactions(prefix string) (*types.TrieIndex, error)

type S3Backend

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

func NewS3Backend

func NewS3Backend(awsConfig *aws.Config, bucket string, pathPrefix string, parallel uint32) (*S3Backend, error)

func (*S3Backend) Flush

func (s *S3Backend) Flush(indexes map[string]types.NamedIndices) error

func (*S3Backend) FlushAccounts

func (s *S3Backend) FlushAccounts(accounts []string) error

func (*S3Backend) FlushTransactions

func (s *S3Backend) FlushTransactions(indexes map[string]*types.TrieIndex) error

func (*S3Backend) Read

func (s *S3Backend) Read(account string) (types.NamedIndices, error)

func (*S3Backend) ReadAccounts

func (s *S3Backend) ReadAccounts() ([]string, error)

func (*S3Backend) ReadTransactions

func (s *S3Backend) ReadTransactions(prefix string) (*types.TrieIndex, error)

Jump to

Keyboard shortcuts

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