multilogs

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2021 License: MIT Imports: 30 Imported by: 1

Documentation

Index

Constants

View Source
const IndexNameFeeds = "userFeeds"
View Source
const IndexNamePrivates = "privates"

Variables

This section is empty.

Functions

func UserFeedsUpdate

func UserFeedsUpdate(ctx context.Context, seq int64, value interface{}, mlog multilog.MultiLog) error

Types

type CombinedIndex

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

func NewCombinedIndex

func NewCombinedIndex(
	repoPath string,
	box *private.Manager,
	self refs.FeedRef,
	rxlog margaret.Log,
	u, p, bt, tan *roaring.MultiLog,
	oh multilog.MultiLog,
	sm *statematrix.StateMatrix,
) (*CombinedIndex, error)

NewCombinedIndex creates one big index which updates the multilogs users, byType, private and tangles. Compared to the "old" fatbot approach of just having 4 independant indexes, this one updates all 4 of them, resulting in less read-overhead while also being able to index private massages by tangle and type.

func (*CombinedIndex) Box2Reindex

func (idx *CombinedIndex) Box2Reindex(author refs.FeedRef) error

Box2Reindex takes advantage of the other bitmap indexes to reindex just the messages from the passed author that are box2 but not yet readable by us.

  1. taking private:meta:box2
  2. ANDing it with the one of the author (intersection)
  3. subtracting all the messages we _can_ read (private:box2:$ourFeed)

func (*CombinedIndex) Close

func (idx *CombinedIndex) Close() error

func (*CombinedIndex) Pour

func (idx *CombinedIndex) Pour(ctx context.Context, swv interface{}) error

Pour calls the processing function to add a value to a sublog.

func (*CombinedIndex) QuerySpec

func (idx *CombinedIndex) QuerySpec() margaret.QuerySpec

QuerySpec returns the query spec that queries the next needed messages from the log

type Members

type Members map[string]bool

type MembershipStore

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

MembershipStore isn't strictly a multilog but putting it in package private gave cyclic import

func NewMembershipIndex

func NewMembershipIndex(logger log.Logger, db *badger.DB, self refs.FeedRef, unboxer *private.Manager, comb *CombinedIndex) (*MembershipStore, librarian.SinkIndex)

NewMembershipIndex tracks group/add-member messages and triggers re-reading box2 messages by the invited people that couldn't be read before.

func (MembershipStore) Close

func (mc MembershipStore) Close() error

type Private

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

func (Private) OpenRoaring

func (pr Private) OpenRoaring(r repo.Interface, db *badger.DB) (multilog.MultiLog, librarian.SinkIndex, error)

OpenRoaring uses roaring bitmaps with a slim key-value store backend

Jump to

Keyboard shortcuts

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