query

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: 9 Imported by: 0

Documentation

Overview

Package query holds the first version of a generic query engine for go-ssb. The Subset operations are able to combine arbitrary boolen combinations of type:xzy and author:@foo filters into one result.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SubsetOperation

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

SubsetOperation encapsulates the recursive structure of operations for the QuerySubset*() methods

func NewSubsetAndCombination

func NewSubsetAndCombination(ops ...SubsetOperation) SubsetOperation

NewSubsetAndCombination turns the list of passed operations into a logical combination where all of them need to apply

func NewSubsetOpByAuthor

func NewSubsetOpByAuthor(a refs.FeedRef) SubsetOperation

NewSubsetOpByAuthor returns a single operation which filters messages by author

func NewSubsetOpByType

func NewSubsetOpByType(value string) SubsetOperation

NewSubsetOpByType returns a single operation which filters messages by type

func NewSubsetOrCombination

func NewSubsetOrCombination(ops ...SubsetOperation) SubsetOperation

NewSubsetOrCombination turns the list of passed operations into a logical combination where any of them needs to apply

func (SubsetOperation) MarshalJSON

func (so SubsetOperation) MarshalJSON() ([]byte, error)

MarshalJSON turns a SubsetOperation into JSON for remote calls.

func (*SubsetOperation) UnmarshalJSON

func (so *SubsetOperation) UnmarshalJSON(input []byte) error

UnmarshalJSON turns JSON into a SubsetOperation and validates it.

type SubsetOptions

type SubsetOptions struct {
	Keys       bool `json:"keys"` // can't omit this falsy value, the JS-stack stack assumes true if it's not there
	Descending bool `json:"descending,omitempty"`
	PageLimit  int  `json:"pageLimit,omitempty"`
}

SubsetOptions defines additional options for the getSubset rpc call

type SubsetPlaner

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

func NewSubsetPlaner

func NewSubsetPlaner(authors, bytype *roaring.MultiLog) *SubsetPlaner

func (*SubsetPlaner) QuerySubsetBitmap

func (sp *SubsetPlaner) QuerySubsetBitmap(qry SubsetOperation) (*sroar.Bitmap, error)

QuerySubsetBitmap evaluates the passed SubsetOperation and returns a bitmap which maps to messages in the receive log.

func (*SubsetPlaner) QuerySubsetMessageRefs

func (sp *SubsetPlaner) QuerySubsetMessageRefs(rxLog margaret.Log, qry SubsetOperation) ([]refs.MessageRef, error)

QuerySubsetMessageRefs evaluates the passed SubsetOperation and returns a slice of message references

Jump to

Keyboard shortcuts

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