Documentation ¶
Index ¶
- type Provider
- func (s *Provider) AddActivity(activity *vocab.ActivityType) error
- func (s *Provider) AddReference(referenceType spi.ReferenceType, objectIRI *url.URL, referenceIRI *url.URL, ...) error
- func (s *Provider) DeleteReference(referenceType spi.ReferenceType, objectIRI, referenceIRI *url.URL) error
- func (s *Provider) GetActivity(activityID *url.URL) (*vocab.ActivityType, error)
- func (s *Provider) GetActor(iri *url.URL) (*vocab.ActorType, error)
- func (s *Provider) PutActor(actor *vocab.ActorType) error
- func (s *Provider) QueryActivities(query *spi.Criteria, opts ...spi.QueryOpt) (spi.ActivityIterator, error)
- func (s *Provider) QueryReferences(referenceType spi.ReferenceType, query *spi.Criteria, opts ...spi.QueryOpt) (spi.ReferenceIterator, error)
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 ¶
GetActivity returns the activity for the given ID from the activity store or ErrNotFound error if it wasn't found.
func (*Provider) GetActor ¶
GetActor returns the actor for the given IRI. Returns an ErrNoFound error if the actor is not in the store.
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.