Documentation ¶
Index ¶
- type ActivityIterator
- type ReferenceIterator
- type Store
- func (s *Store) AddActivity(activity *vocab.ActivityType) error
- func (s *Store) AddReference(referenceType spi.ReferenceType, objectIRI *url.URL, referenceIRI *url.URL, ...) error
- func (s *Store) DeleteReference(referenceType spi.ReferenceType, objectIRI, referenceIRI *url.URL) error
- func (s *Store) GetActivity(activityID *url.URL) (*vocab.ActivityType, error)
- func (s *Store) GetActor(iri *url.URL) (*vocab.ActorType, error)
- func (s *Store) PutActor(actor *vocab.ActorType) error
- func (s *Store) QueryActivities(query *spi.Criteria, opts ...spi.QueryOpt) (spi.ActivityIterator, error)
- func (s *Store) QueryReferences(refType 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 ActivityIterator ¶
type ActivityIterator struct {
// contains filtered or unexported fields
}
ActivityIterator is used to iterator over activities.
func NewActivityIterator ¶
func NewActivityIterator(results []*vocab.ActivityType, totalItems int) *ActivityIterator
NewActivityIterator creates a new ActivityIterator.
func (*ActivityIterator) Next ¶
func (it *ActivityIterator) Next() (*vocab.ActivityType, error)
Next returns the next activity or an ErrNotFound error if there are no more items.
func (ActivityIterator) TotalItems ¶
type ReferenceIterator ¶
type ReferenceIterator struct {
// contains filtered or unexported fields
}
ReferenceIterator is used to iterator over references.
func NewReferenceIterator ¶
func NewReferenceIterator(results []*url.URL, totalItems int) *ReferenceIterator
NewReferenceIterator creates a new ReferenceIterator.
func (*ReferenceIterator) Next ¶
func (it *ReferenceIterator) Next() (*url.URL, error)
Next returns the next reference or an ErrNotFound error if there are no more items.
func (ReferenceIterator) TotalItems ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store implements an in-memory ActivityPub store.
func (*Store) AddActivity ¶
func (s *Store) AddActivity(activity *vocab.ActivityType) error
AddActivity adds the given activity to the activity store.
func (*Store) AddReference ¶
func (s *Store) 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 (*Store) DeleteReference ¶
func (s *Store) DeleteReference(referenceType spi.ReferenceType, objectIRI, referenceIRI *url.URL) error
DeleteReference deletes the reference of the given type from the given actor.
func (*Store) GetActivity ¶
GetActivity returns the activity for the given ID from the activity store or ErrNotFound error if it wasn't found.
func (*Store) GetActor ¶
GetActor returns the actor for the given IRI. Returns an ErrNoFound error if the actor is not in the store.
func (*Store) QueryActivities ¶
func (s *Store) 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 (*Store) QueryReferences ¶
func (s *Store) QueryReferences(refType 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.