memstore

package
v1.6.3 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2025 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultPruneInterval = 500 * time.Millisecond
	BytesPerFieldElement = 32
)

Variables

View Source
var (
	EnabledFlagName    = withFlagPrefix("enabled")
	ExpirationFlagName = withFlagPrefix("expiration")
	PutLatencyFlagName = withFlagPrefix("put-latency")
	GetLatencyFlagName = withFlagPrefix("get-latency")
)

Functions

func CLIFlags

func CLIFlags(envPrefix, category string) []cli.Flag

CLIFlags ... used for memstore backend configuration category is used to group the flags in the help output (see https://cli.urfave.org/v2/examples/flags/#grouping)

Types

type Config

type Config struct {
	MaxBlobSizeBytes uint64
	BlobExpiration   time.Duration
	// artificial latency added for memstore backend to mimic eigenda's latency
	PutLatency time.Duration
	GetLatency time.Duration
}

func ReadConfig

func ReadConfig(ctx *cli.Context) Config

type MemStore

type MemStore struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

MemStore is a simple in-memory store for blobs which uses an expiration time to evict blobs to best emulate the ephemeral nature of blobs dispersed to EigenDA operators.

func New

func New(
	ctx context.Context, verifier *verify.Verifier, l log.Logger, config Config,
) (*MemStore, error)

New ... constructor

func (*MemStore) BackendType

func (e *MemStore) BackendType() common.BackendType

func (*MemStore) Get

func (e *MemStore) Get(_ context.Context, commit []byte) ([]byte, error)

Get fetches a value from the store.

func (*MemStore) Put

func (e *MemStore) Put(_ context.Context, value []byte) ([]byte, error)

Put inserts a value into the store.

func (*MemStore) Verify

func (e *MemStore) Verify(_ context.Context, _, _ []byte) error

Jump to

Keyboard shortcuts

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