storage

package
v0.0.0-...-1ecd636 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2026 License: BSD-2-Clause Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FeatureAnnotationStorage

type FeatureAnnotationStorage interface {
	// Create stores a new feature annotation
	Create(annotation *feature.FeatureAnnotation) error

	// GetByID retrieves a feature annotation by its ID
	GetByID(id string) (*feature.FeatureAnnotation, error)

	// GetByName retrieves a feature annotation by its name
	GetByName(name string) (*feature.FeatureAnnotation, error)

	// Update modifies an existing feature annotation
	Update(id string, annotation *feature.FeatureAnnotation) error

	// Delete removes a feature annotation (soft delete if purge=false)
	Delete(id string, purge bool) error

	// AddTag adds a tag property to a feature annotation
	AddTag(id string, tag *feature.TagProperty) error

	// AddTags adds multiple tag properties to a feature annotation
	AddTags(id string, tags []*feature.TagProperty) error

	// SetTags replaces all existing tags with the provided tags (idempotent full-update)
	SetTags(id string, tags []*feature.TagProperty) error

	// UpdateTag modifies an existing tag in a feature annotation
	UpdateTag(id string, tagName string, tag *feature.TagProperty) error

	// RemoveTag removes a tag from a feature annotation
	RemoveTag(id string, tagName string) error

	// RemoveTags removes a tag with specific tag name and value from a feature annotation
	RemoveTags(id string, tag string, value string) error

	// ListByPubmedID retrieves feature annotations by PubMed ID
	ListByPubmedID(pubmedID string) ([]*feature.FeatureAnnotation, error)

	// ListByDOI retrieves feature annotations by DOI
	ListByDOI(doi string) ([]*feature.FeatureAnnotation, error)
}

FeatureAnnotationStorage defines the interface for feature annotation storage operations

func NewLevelDBStorage

func NewLevelDBStorage(
	logger *logrus.Logger,
) (FeatureAnnotationStorage, error)

type LevelDBStorage

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

func (*LevelDBStorage) AddTag

func (s *LevelDBStorage) AddTag(id string, tag *feature.TagProperty) error

func (*LevelDBStorage) AddTags

func (s *LevelDBStorage) AddTags(id string, tags []*feature.TagProperty) error

func (*LevelDBStorage) Close

func (s *LevelDBStorage) Close() error

func (*LevelDBStorage) Create

func (s *LevelDBStorage) Create(annotation *feature.FeatureAnnotation) error

func (*LevelDBStorage) Delete

func (s *LevelDBStorage) Delete(id string, purge bool) error

func (*LevelDBStorage) GetByID

func (s *LevelDBStorage) GetByID(
	id string,
) (*feature.FeatureAnnotation, error)

func (*LevelDBStorage) GetByName

func (s *LevelDBStorage) GetByName(
	name string,
) (*feature.FeatureAnnotation, error)

func (*LevelDBStorage) ListByDOI

func (s *LevelDBStorage) ListByDOI(
	doi string,
) ([]*feature.FeatureAnnotation, error)

func (*LevelDBStorage) ListByPubmedID

func (s *LevelDBStorage) ListByPubmedID(
	pubmedID string,
) ([]*feature.FeatureAnnotation, error)

func (*LevelDBStorage) RemoveTag

func (s *LevelDBStorage) RemoveTag(id string, tagName string) error

func (*LevelDBStorage) RemoveTags

func (s *LevelDBStorage) RemoveTags(id string, tag string, value string) error

RemoveTags removes a tag with specific tag name and value from a feature annotation.

func (*LevelDBStorage) SetTags

func (s *LevelDBStorage) SetTags(id string, tags []*feature.TagProperty) error

func (*LevelDBStorage) Update

func (s *LevelDBStorage) Update(
	id string,
	annotation *feature.FeatureAnnotation,
) error

func (*LevelDBStorage) UpdateTag

func (s *LevelDBStorage) UpdateTag(
	id string,
	tagName string,
	tag *feature.TagProperty,
) error

type MemoryStorage

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

MemoryStorage implements FeatureAnnotationStorage using in-memory maps

func NewMemoryStorage

func NewMemoryStorage(logger *logrus.Logger) *MemoryStorage

NewMemoryStorage creates a new in-memory storage instance

func (*MemoryStorage) AddTag

func (m *MemoryStorage) AddTag(id string, tag *feature.TagProperty) error

AddTag adds a tag property to a feature annotation

func (*MemoryStorage) AddTags

func (m *MemoryStorage) AddTags(id string, tags []*feature.TagProperty) error

AddTags adds multiple tag properties to a feature annotation

func (*MemoryStorage) Create

func (m *MemoryStorage) Create(annotation *feature.FeatureAnnotation) error

Create stores a new feature annotation

func (*MemoryStorage) Delete

func (m *MemoryStorage) Delete(id string, purge bool) error

Delete removes a feature annotation

func (*MemoryStorage) GetByID

func (m *MemoryStorage) GetByID(id string) (*feature.FeatureAnnotation, error)

GetByID retrieves a feature annotation by its ID

func (*MemoryStorage) GetByName

func (m *MemoryStorage) GetByName(
	name string,
) (*feature.FeatureAnnotation, error)

GetByName retrieves a feature annotation by its name

func (*MemoryStorage) ListByDOI

func (m *MemoryStorage) ListByDOI(
	doi string,
) ([]*feature.FeatureAnnotation, error)

ListByDOI retrieves feature annotations by DOI

func (*MemoryStorage) ListByPubmedID

func (m *MemoryStorage) ListByPubmedID(
	pubmedID string,
) ([]*feature.FeatureAnnotation, error)

ListByPubmedID retrieves feature annotations by PubMed ID

func (*MemoryStorage) RemoveTag

func (m *MemoryStorage) RemoveTag(id string, tagName string) error

RemoveTag removes a tag from a feature annotation

func (*MemoryStorage) RemoveTags

func (m *MemoryStorage) RemoveTags(id string, tag string, value string) error

RemoveTags removes a tag with specific tag name and value from a feature annotation

func (*MemoryStorage) SetTags

func (m *MemoryStorage) SetTags(id string, tags []*feature.TagProperty) error

SetTags replaces all existing tags with the provided tags (idempotent full-update)

func (*MemoryStorage) Update

func (m *MemoryStorage) Update(
	id string,
	annotation *feature.FeatureAnnotation,
) error

Update modifies an existing feature annotation

func (*MemoryStorage) UpdateTag

func (m *MemoryStorage) UpdateTag(
	id string,
	tagName string,
	tag *feature.TagProperty,
) error

UpdateTag modifies an existing tag in a feature annotation

Jump to

Keyboard shortcuts

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