mmm

package
v0.0.0-...-78f6509 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2026 License: Unlicense Imports: 24 Imported by: 2

Documentation

Index

Constants

View Source
const (
	MMAP_INFINITE_SIZE = 1 << 40
)

Variables

This section is empty.

Functions

This section is empty.

Types

type EventStats

type EventStats struct {
	Total     uint
	PerWeek   []uint
	PerPubKey map[nostr.PubKey]PubKeyStats
	PerKind   map[nostr.Kind]KindStats
}

type IndexingLayer

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

func (*IndexingLayer) Close

func (il *IndexingLayer) Close()

func (*IndexingLayer) ComputeStats

func (il *IndexingLayer) ComputeStats(opts StatsOptions) (EventStats, error)

func (*IndexingLayer) CountEvents

func (il *IndexingLayer) CountEvents(filter nostr.Filter) (uint32, error)

func (*IndexingLayer) DeleteEvent

func (il *IndexingLayer) DeleteEvent(id nostr.ID) error

func (*IndexingLayer) HasAtPosition

func (il *IndexingLayer) HasAtPosition(offset uint64) (
	exists bool,
	createdAt nostr.Timestamp,
	kind nostr.Kind,
)

func (*IndexingLayer) Init

func (il *IndexingLayer) Init() error

func (*IndexingLayer) Name

func (il *IndexingLayer) Name() string

func (*IndexingLayer) QueryEvents

func (il *IndexingLayer) QueryEvents(filter nostr.Filter, maxLimit int) iter.Seq[nostr.Event]

func (*IndexingLayer) ReplaceEvent

func (il *IndexingLayer) ReplaceEvent(evt nostr.Event) error

func (*IndexingLayer) SaveEvent

func (il *IndexingLayer) SaveEvent(evt nostr.Event) error

type IndexingLayers

type IndexingLayers []*IndexingLayer

func (IndexingLayers) ByID

func (ils IndexingLayers) ByID(ilid uint16) *IndexingLayer

type KindStats

type KindStats struct {
	Total   uint
	PerWeek []uint
}

type MultiMmapManager

type MultiMmapManager struct {
	Dir    string
	Logger *zerolog.Logger
	// contains filtered or unexported fields
}

func (*MultiMmapManager) Close

func (b *MultiMmapManager) Close()

func (*MultiMmapManager) DebugAtPosition

func (b *MultiMmapManager) DebugAtPosition(offset uint64) (idPrefix []byte, layers []*IndexingLayer)

func (*MultiMmapManager) DropLayer

func (b *MultiMmapManager) DropLayer(name string) error

func (*MultiMmapManager) EnsureLayer

func (b *MultiMmapManager) EnsureLayer(name string) (*IndexingLayer, error)

func (*MultiMmapManager) GetByID

func (b *MultiMmapManager) GetByID(id nostr.ID) (*nostr.Event, IndexingLayers)

GetByID returns the event -- if found in this mmm -- and all the IndexingLayers it belongs to.

func (*MultiMmapManager) Init

func (b *MultiMmapManager) Init() error

func (*MultiMmapManager) Rescan

func (b *MultiMmapManager) Rescan() error

func (*MultiMmapManager) String

func (b *MultiMmapManager) String() string

type PubKeyStats

type PubKeyStats struct {
	Total          uint
	PerWeek        []uint
	PerKind        map[nostr.Kind]uint
	PerKindPerWeek map[nostr.Kind][]uint
}

type StatsOptions

type StatsOptions struct {
	OnlyPubKey nostr.PubKey
}

Jump to

Keyboard shortcuts

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