Documentation ¶
Index ¶
- Variables
- func ExtractActor(li vocab.LinkOrIRI) []uint64
- func ExtractAttributedTo(li vocab.LinkOrIRI) []uint64
- func ExtractCollectionItems(li vocab.LinkOrIRI) []uint64
- func ExtractContent(li vocab.LinkOrIRI) []string
- func ExtractID(li vocab.LinkOrIRI) []uint64
- func ExtractInReplyTo(li vocab.LinkOrIRI) []uint64
- func ExtractName(li vocab.LinkOrIRI) []string
- func ExtractNatLangVal(nlv vocab.NaturalLanguageValues) []string
- func ExtractObject(li vocab.LinkOrIRI) []uint64
- func ExtractPreferredUsername(li vocab.LinkOrIRI) []string
- func ExtractPublished(li vocab.LinkOrIRI) []uint64
- func ExtractRecipients(li vocab.LinkOrIRI) []uint64
- func ExtractSummary(li vocab.LinkOrIRI) []string
- func ExtractType(li vocab.LinkOrIRI) []string
- func ExtractUpdated(li vocab.LinkOrIRI) []uint64
- func GetBitmaps[T Tokenizable](in Indexable, tokens ...T) []*roaring64.Bitmap
- type ExtractFnType
- type HashFnType
- type Index
- type Indexable
- type Tokenizable
- type Type
Constants ¶
This section is empty.
Variables ¶
var HashSeed uint32 = 666
Functions ¶
func ExtractActor ¶
ExtractActor returns the vocab.IRI tokens corresponding to the "actor" property of the received vocab.IntransitiveActivity
func ExtractAttributedTo ¶
ExtractAttributedTo returns the vocab.IRI tokens corresponding to the "attributedTo" property of the received vocab.Item
func ExtractCollectionItems ¶
ExtractCollectionItems returns the vocab.IRI tokens corresponding to the items in the collection of the received vocab.Item
func ExtractContent ¶
ExtractContent returns the tokens in the "content" property of the vocab.Item
func ExtractID ¶
ExtractID returns the vocab.IRI token corresponding to the "ID" property of the received vocab.Item
func ExtractInReplyTo ¶
ExtractInReplyTo returns the vocab.IRI tokens corresponding to the "inReplyTo" property of the received vocab.Item
func ExtractName ¶
ExtractName returns a single token composed of the "name" property of the vocab.LinkOrIRI. This works on both vocab.Link and vocab.Item objects.
func ExtractNatLangVal ¶
func ExtractNatLangVal(nlv vocab.NaturalLanguageValues) []string
ExtractNatLangVal extracts a single token from the value of the vocab.NaturalLanguageValues value. This is meant for the properties that contain single words like "preferredUsername" or "name".
func ExtractObject ¶
ExtractObject returns the vocab.IRI tokens corresponding to the "object" property of the received vocab.Activity
func ExtractPreferredUsername ¶
ExtractPreferredUsername returns a single token composed of the "preferredUsername" property of the vocab.Actor
func ExtractPublished ¶
ExtractPublished returns the vocab.IRI tokens corresponding to the Published property the received vocab.Object
func ExtractRecipients ¶
ExtractRecipients returns the vocab.IRI tokens corresponding to the various addressing properties of the received vocab.Item. NOTE(marius): Currently it includes *all* the addressing fields, not removing the "blind" ones (Bto and BCC)
func ExtractSummary ¶
ExtractSummary returns the tokens in the "summary" property of the vocab.Item
func ExtractType ¶
ExtractType returns the "type" of the vocab.LinkOrIRI. This works on both vocab.Link and vocab.Item objects.
func ExtractUpdated ¶
ExtractUpdated returns the vocab.IRI tokens corresponding to the Updated property the received vocab.Object
func GetBitmaps ¶
func GetBitmaps[T Tokenizable](in Indexable, tokens ...T) []*roaring64.Bitmap
GetBitmaps returns the ORing of the underlying search bitmaps corresponding to the received tokens, or to the reverse of the returned tokens if the neg parameter is set.
Types ¶
type ExtractFnType ¶
type ExtractFnType[T Tokenizable] func(vocab.LinkOrIRI) []T
type Index ¶
type Index struct { Ref map[uint64]vocab.IRI Indexes map[Type]Indexable // contains filtered or unexported fields }
Index represents a full index It contains the fast tokenized bitmaps, together with a cross-reference map that provides the corresponding vocab.IRI list that results after resolving the bitmap searches.
func Full ¶
func Full() *Index
Full returns a full index data type. The complete list of types can be found in the "ByXX" constants.
func Partial ¶
Partial returns a partial index. It will create tokenized bitmaps only for the types it receives as parameters. The types can be found in the "ByXX" constants.
func (*Index) Add ¶
Add adds a vocab.LinkOrIRI object to the index.
func (*Index) MarshalBinary ¶
func (*Index) UnmarshalBinary ¶
type Indexable ¶
func NewIndex ¶
func NewIndex[T Tokenizable](refsExtractFn ExtractFnType[uint64], tokExtractFn ExtractFnType[T]) Indexable
NewTokenIndex intializes a new tokenMap index where the function to extract the references that get indexed is passed directly.
func NewTokenIndex ¶
func NewTokenIndex[T Tokenizable](extractFn ExtractFnType[T]) Indexable
NewTokenIndex intializes a new tokenMap index where the reference extraction function returns the indexed reference based on the ActivityPub Object ID.