ariesstore

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2022 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Provider

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

Provider implements an ActivityPub store backed by an Aries storage provider.

func New

func New(serviceName string, provider ariesstorage.Provider, multipleTagQueryCapable bool) (*Provider, error)

New returns a new ActivityPub storage provider. If multipleTagQueryCapable is set to true, then reference queries can be done using both the object IRI and activity type tags at the same time. NodeInfo uses this to optimize memory usage. Right now only the MongoDB provider supports this setting.

func (*Provider) AddActivity

func (s *Provider) AddActivity(activity *vocab.ActivityType) error

AddActivity adds the given activity to the activity store.

func (*Provider) AddReference

func (s *Provider) AddReference(referenceType spi.ReferenceType, objectIRI *url.URL, referenceIRI *url.URL,
	refMetaDataOpts ...spi.RefMetadataOpt) error

AddReference adds the reference of the given type to the given object.

func (*Provider) DeleteReference

func (s *Provider) DeleteReference(referenceType spi.ReferenceType, objectIRI, referenceIRI *url.URL) error

DeleteReference deletes the reference of the given type from the given object.

func (*Provider) GetActivity

func (s *Provider) GetActivity(activityID *url.URL) (*vocab.ActivityType, error)

GetActivity returns the activity for the given ID from the activity store or ErrNotFound error if it wasn't found.

func (*Provider) QueryActivities

func (s *Provider) QueryActivities(query *spi.Criteria, opts ...spi.QueryOpt) (spi.ActivityIterator, error)

QueryActivities queries the given activity store using the provided criteria and returns a results iterator.

func (*Provider) QueryReferences

func (s *Provider) QueryReferences(referenceType spi.ReferenceType, query *spi.Criteria,
	opts ...spi.QueryOpt) (spi.ReferenceIterator, error)

QueryReferences returns the list of references of the given type according to the given query.

Jump to

Keyboard shortcuts

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