stores

package
v0.0.0-...-9146c5d Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildDagFromStore

func BuildDagFromStore(store Store, root string, includeContent bool) (*types.DagData, error)

func BuildPartialDagFromStore

func BuildPartialDagFromStore(store Store, root string, leafHashes []string, includeContent bool, pruneLinks bool) (*types.DagData, error)

Returns a partial DAG with merkle proofs for verification.

func StoreDag

func StoreDag(store Store, dag *types.DagData) error

Types

type Store

type Store interface {
	Cleanup() error

	// IsClosed returns true if the store has been closed
	IsClosed() bool

	// Statistics Store
	GetStatsStore() statistics.StatisticsStore

	// Hornet Storage
	StoreLeaf(root string, leafData *types.DagLeafData) error
	RetrieveLeaf(root string, hash string, includeContent bool) (*types.DagLeafData, error)
	QueryDag(filter lib_types.QueryFilter) ([]string, error)
	StoreDag(dag *types.DagData) error
	BuildDagFromStore(root string, includeContent bool) (*types.DagData, error)
	BuildPartialDagFromStore(root string, leafHashes []string, includeContent bool, pruneLinks bool) (*types.DagData, error)
	RetrieveContent(rootCID cid.Cid, contentHash []byte) ([]byte, error)
	DeleteDag(root string) error
	CacheLabels(dag *merkle_dag.Dag) error
	RetrieveLabels(root string) (map[string]string, error)
	CreateDagStoreForRoot(root string, publicKey string, signature string) *merkle_dag.DagStore
	CreateDagStoreFromExisting(root string) (*merkle_dag.DagStore, error)
	CacheRelationshipsStreaming(dagStore *merkle_dag.DagStore) error
	CacheLabelsStreaming(dagStore *merkle_dag.DagStore) error
	RetrieveRelationships(root string) (map[string]string, error)

	// Partial DAG support - for verifying referenced leaves exist globally
	HasLeafGlobal(hash string) (bool, error)
	GetLeafLinksGlobal(hash string) ([]string, error)

	// Ownership management
	ClaimOwnership(root string, publicKey string, signature string) error
	GetOwnership(root string) ([]types.DagOwnership, error)
	FindRootForLeaf(leafHash string) (string, error)

	// Nostr
	QueryEvents(filter nostr.Filter) ([]*nostr.Event, error)
	StoreEvent(event *nostr.Event) error
	DeleteEvent(eventID string) error
	QueryBlobs(mimeType string) ([]string, error)

	// Moderation
	AddToPendingModeration(eventID string, imageURLs []string) error
	RemoveFromPendingModeration(eventID string) error
	IsPendingModeration(eventID string) (bool, error)
	GetPendingModerationEvents() ([]types.PendingModeration, error)
	GetAndRemovePendingModeration(batchSize int) ([]types.PendingModeration, error)
	MarkEventBlocked(eventID string, timestamp int64) error
	MarkEventBlockedWithDetails(eventID string, timestamp int64, reason string, contentLevel int, mediaURL string) error
	DeleteBlockedEventsOlderThan(age int64) (int, error)
	DeleteResolutionEventsOlderThan(age int64) (int, error)
	IsEventBlocked(eventID string) (bool, error)
	UnmarkEventBlocked(eventID string) error

	// Dispute Moderation
	AddToPendingDisputeModeration(disputeID string, ticketID string, eventID string, mediaURL string, disputeReason string, userPubKey string) error
	RemoveFromPendingDisputeModeration(disputeID string) error
	IsPendingDisputeModeration(disputeID string) (bool, error)
	GetPendingDisputeModerationEvents() ([]types.PendingDisputeModeration, error)
	GetAndRemovePendingDisputeModeration(batchSize int) ([]types.PendingDisputeModeration, error)
	MarkEventDisputed(eventID string) error
	HasEventDispute(eventID string) (bool, error)
	HasUserDisputedEvent(eventID string, userPubKey string) (bool, error)

	// Pubkey Blocking
	IsBlockedPubkey(pubkey string) (bool, error)
	BlockPubkey(pubkey string, reason string) error
	UnblockPubkey(pubkey string) error
	ListBlockedPubkeys() ([]types.BlockedPubkey, error)

	// Blossom
	StoreBlob(data []byte, hash []byte, publicKey string) error
	GetBlob(hash string) ([]byte, error)
	DeleteBlob(hash string) error

	// Panel
	GetSubscriber(npub string) (*types.Subscriber, error)
	GetSubscriberByAddress(address string) (*types.Subscriber, error)
	SaveSubscriber(subscriber *types.Subscriber) error
	AllocateBitcoinAddress(npub string) (*types.Address, error)
	SaveAddress(addr *types.Address) error
	AllocateAddress() (*types.Address, error)
}

Directories

Path Synopsis
kvp

Jump to

Keyboard shortcuts

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