datastore

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotSupported = errors.New("codeinterp datastore: operation not supported")

Functions

func ValidateKey

func ValidateKey(key string, maxLen int) error

Types

type BlobDataStore

type BlobDataStore struct{}

func NewBlobDataStore

func NewBlobDataStore() *BlobDataStore

func (*BlobDataStore) Close

func (b *BlobDataStore) Close() error

func (*BlobDataStore) Delete

func (b *BlobDataStore) Delete(string) error

func (*BlobDataStore) List

func (b *BlobDataStore) List(string) ([]string, error)

func (*BlobDataStore) Read

func (b *BlobDataStore) Read(string) ([]byte, error)

func (*BlobDataStore) ReadRange

func (b *BlobDataStore) ReadRange(string, int64, int64) ([]byte, error)

func (*BlobDataStore) Write

func (b *BlobDataStore) Write(string, []byte) error

type DataStore

type DataStore interface {
	Write(key string, data []byte) error
	Read(key string) ([]byte, error)
	ReadRange(key string, offset, limit int64) ([]byte, error)
	List(prefix string) ([]string, error)
	Delete(key string) error
	Close() error
}

type FSDataStore

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

func NewFSDataStore

func NewFSDataStore(root string, maxBytes int64, maxKey int, maxValue int64) (*FSDataStore, error)

func (*FSDataStore) Close

func (f *FSDataStore) Close() error

func (*FSDataStore) Delete

func (f *FSDataStore) Delete(key string) error

func (*FSDataStore) List

func (f *FSDataStore) List(prefix string) ([]string, error)

func (*FSDataStore) Read

func (f *FSDataStore) Read(key string) ([]byte, error)

func (*FSDataStore) ReadRange

func (f *FSDataStore) ReadRange(key string, offset, limit int64) ([]byte, error)

func (*FSDataStore) Search

func (f *FSDataStore) Search(keyPrefix string, pattern string) ([]Match, error)

func (*FSDataStore) Write

func (f *FSDataStore) Write(key string, data []byte) error

type Match

type Match struct {
	Key     string
	Line    int
	Column  int
	Content string
}

type MemoryDataStore

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

func NewMemoryDataStore

func NewMemoryDataStore(maxBytes int64, maxKey int, maxValue int64) *MemoryDataStore

func (*MemoryDataStore) Close

func (m *MemoryDataStore) Close() error

func (*MemoryDataStore) Delete

func (m *MemoryDataStore) Delete(key string) error

func (*MemoryDataStore) List

func (m *MemoryDataStore) List(prefix string) ([]string, error)

func (*MemoryDataStore) Read

func (m *MemoryDataStore) Read(key string) ([]byte, error)

func (*MemoryDataStore) ReadRange

func (m *MemoryDataStore) ReadRange(key string, offset, limit int64) ([]byte, error)

func (*MemoryDataStore) Search

func (m *MemoryDataStore) Search(keyPrefix string, pattern string) ([]Match, error)

func (*MemoryDataStore) Write

func (m *MemoryDataStore) Write(key string, data []byte) error

type SQLDataStore

type SQLDataStore struct{}

func NewSQLDataStore

func NewSQLDataStore() *SQLDataStore

func (*SQLDataStore) Close

func (s *SQLDataStore) Close() error

func (*SQLDataStore) Delete

func (s *SQLDataStore) Delete(string) error

func (*SQLDataStore) List

func (s *SQLDataStore) List(string) ([]string, error)

func (*SQLDataStore) Read

func (s *SQLDataStore) Read(string) ([]byte, error)

func (*SQLDataStore) ReadRange

func (s *SQLDataStore) ReadRange(string, int64, int64) ([]byte, error)

func (*SQLDataStore) Write

func (s *SQLDataStore) Write(string, []byte) error

type SearchableDataStore

type SearchableDataStore interface {
	Search(keyPrefix string, pattern string) ([]Match, error)
}

Jump to

Keyboard shortcuts

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