Documentation ¶
Index ¶
- type Datastore
- func (d *Datastore) AddActivityToActivities(ctx context.Context, activity vocab.Type, objectID primitive.ObjectID) error
- func (d *Datastore) AddActivityToActorInbox(ctx context.Context, activity vocab.Type, username string, inReplyTo *url.URL) error
- func (d *Datastore) AddActivityToOutbox(ctx context.Context, activity vocab.Type, username string) error
- func (d *Datastore) AddActivityToPublicInbox(ctx context.Context, activity vocab.Type, objectID primitive.ObjectID, ...) error
- func (d *Datastore) AddActorToFollows(ctx context.Context, actorID, followerID string) error
- func (d *Datastore) AddFollowerToActor(ctx context.Context, actorID, followerID string) error
- func (d *Datastore) AddHostToSameInstitute(ctx context.Context, instance *url.URL) error
- func (d *Datastore) AddObjectsToActorInbox(ctx context.Context, objects []vocab.Type, userID string) error
- func (d *Datastore) AddReplyToActivity(ctx context.Context, object vocab.Type, inReplyTo *url.URL) error
- func (d *Datastore) CreateUser(ctx context.Context, user *user.User) error
- func (d *Datastore) DeleteObjectFromAllInboxes(ctx context.Context, objectID *url.URL) error
- func (d *Datastore) DeleteObjectFromInbox(ctx context.Context, objectID *url.URL) error
- func (d *Datastore) DeleteObjectFromPublicInbox(ctx context.Context, objectID *url.URL) error
- func (d *Datastore) GetActivityByActivityID(ctx context.Context, activityID string) (activity.Activity, error)
- func (d *Datastore) GetActivityByObjectID(ctx context.Context, activityID, baseURL string) (activity.Activity, error)
- func (d *Datastore) GetActorByActorID(ctx context.Context, actorID string) (actor.Person, error)
- func (d *Datastore) GetActorByUsername(ctx context.Context, username string) (vocab.ActivityStreamsPerson, error)
- func (d *Datastore) GetActorInbox(ctx context.Context, username, minID, maxID string, local bool) (vocab.ActivityStreamsOrderedCollectionPage, error)
- func (d *Datastore) GetActorInboxAsOrderedCollection(ctx context.Context, username string, local bool) (vocab.ActivityStreamsOrderedCollection, error)
- func (d *Datastore) GetActorOutbox(ctx context.Context, username, minID, maxID string) (vocab.ActivityStreamsOrderedCollectionPage, error)
- func (d *Datastore) GetActorOutboxAsOrderedCollection(ctx context.Context, username string) (vocab.ActivityStreamsOrderedCollection, error)
- func (d *Datastore) GetAnnounceStatus(ctx context.Context, actorID, objectID *url.URL) (bool, error)
- func (d *Datastore) GetEventInbox(ctx context.Context, username, minID, maxID string) (vocab.ActivityStreamsOrderedCollectionPage, error)
- func (d *Datastore) GetEventInboxAsOrderedCollection(ctx context.Context, username string) (vocab.ActivityStreamsOrderedCollection, error)
- func (d *Datastore) GetFollowerStatus(ctx context.Context, followerID, followedID string) (int, error)
- func (d *Datastore) GetFollowersByUsername(ctx context.Context, username string) (vocab.ActivityStreamsOrderedCollection, error)
- func (d *Datastore) GetFollowingByUsername(ctx context.Context, username string) (vocab.ActivityStreamsOrderedCollection, error)
- func (d *Datastore) GetLikeStatus(ctx context.Context, actorID, objectID *url.URL) (bool, error)
- func (d *Datastore) GetLikedAsOrderedCollection(ctx context.Context, username string) (vocab.ActivityStreamsOrderedCollection, error)
- func (d *Datastore) GetLikesAsOrderedCollection(ctx context.Context, activityID *url.URL) (vocab.ActivityStreamsOrderedCollection, error)
- func (d *Datastore) GetLikesUsingObjectID(ctx context.Context, activityID string) (vocab.ActivityStreamsOrderedCollection, error)
- func (d *Datastore) GetNotificationsInbox(ctx context.Context, username, minID, maxID string) (vocab.ActivityStreamsOrderedCollectionPage, error)
- func (d *Datastore) GetNotificationsInboxAsOrderedCollection(ctx context.Context, username string) (vocab.ActivityStreamsOrderedCollection, error)
- func (d *Datastore) GetPublicInbox(ctx context.Context, minID string, maxID string, local bool, institute bool) (vocab.ActivityStreamsOrderedCollectionPage, error)
- func (d *Datastore) GetPublicInboxAsOrderedCollection(ctx context.Context, local bool, institute bool) (vocab.ActivityStreamsOrderedCollection, error)
- func (d *Datastore) GetUserByUsername(ctx context.Context, username string) (*user.User, error)
- func (d *Datastore) IsHostSameInstitute(ctx context.Context, instance *url.URL) (bool, error)
- func (d *Datastore) LikeObject(ctx context.Context, objectID *url.URL, actorID *url.URL, activityID *url.URL) error
- func (d *Datastore) RemoveFollowerFromActor(ctx context.Context, actorID, followerID string) error
- func (d *Datastore) UpdateActivity(ctx context.Context, activity vocab.Type, inReplyTo *url.URL) error
- func (d *Datastore) UpdateActor(ctx context.Context, username string, displayName string, summary string, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Datastore ¶
type Datastore struct {
// contains filtered or unexported fields
}
Datastore wraps the MongoDB client and handles MongoDB operations.
func NewDatastore ¶
NewDatastore returns an initialized Datastore which handles MongoDB operations.
func (*Datastore) AddActivityToActivities ¶
func (*Datastore) AddActivityToActorInbox ¶
func (*Datastore) AddActivityToOutbox ¶
func (*Datastore) AddActivityToPublicInbox ¶
func (*Datastore) AddActorToFollows ¶
AddActorToFollows adds the Actor ID to the Follower ID specified.
func (*Datastore) AddFollowerToActor ¶
AddFollowerToActor adds the Follower ID to the Actor ID.
func (*Datastore) AddHostToSameInstitute ¶
func (*Datastore) AddObjectsToActorInbox ¶
func (*Datastore) AddReplyToActivity ¶
func (*Datastore) CreateUser ¶
func (*Datastore) DeleteObjectFromAllInboxes ¶
func (*Datastore) DeleteObjectFromInbox ¶
func (*Datastore) DeleteObjectFromPublicInbox ¶
func (*Datastore) GetActivityByActivityID ¶
func (*Datastore) GetActivityByObjectID ¶
func (*Datastore) GetActorByActorID ¶
GetActorByActorID returns an instance of Person from Mongo using URI.
func (*Datastore) GetActorByUsername ¶
func (d *Datastore) GetActorByUsername(ctx context.Context, username string) (vocab.ActivityStreamsPerson, error)
GetActorByUsername returns an instance of Person from Mongo using Username.
func (*Datastore) GetActorInbox ¶
func (d *Datastore) GetActorInbox(ctx context.Context, username, minID, maxID string, local bool) (vocab.ActivityStreamsOrderedCollectionPage, error)
GetActorInbox paginates the inbox 20 activities at a time using IDs. ObjectIDs exceeding that maxID are ignored, and ObjectIDs under the min ID are ignored.
func (*Datastore) GetActorInboxAsOrderedCollection ¶
func (*Datastore) GetActorOutbox ¶
func (d *Datastore) GetActorOutbox(ctx context.Context, username, minID, maxID string) (vocab.ActivityStreamsOrderedCollectionPage, error)
GetActorOutbox paginates the inbox 20 activities at a time using IDs. ObjectIDs exceeding that maxID are ignored, and ObjectIDs under the min ID are ignored.
func (*Datastore) GetActorOutboxAsOrderedCollection ¶
func (*Datastore) GetAnnounceStatus ¶
func (*Datastore) GetEventInbox ¶
func (d *Datastore) GetEventInbox(ctx context.Context, username, minID, maxID string) (vocab.ActivityStreamsOrderedCollectionPage, error)
GetEventInbox paginates the inbox 20 activities at a time using IDs. ObjectIDs exceeding that maxID are ignored, and ObjectIDs under the min ID are ignored.
func (*Datastore) GetEventInboxAsOrderedCollection ¶
func (d *Datastore) GetEventInboxAsOrderedCollection(ctx context.Context, username string) (vocab.ActivityStreamsOrderedCollection, error)
GetEventInboxAsOrderedCollection returns an OrderedCollection of invites. This method returns events that have yet to take place.
func (*Datastore) GetFollowerStatus ¶
func (*Datastore) GetFollowersByUsername ¶
func (d *Datastore) GetFollowersByUsername(ctx context.Context, username string) (vocab.ActivityStreamsOrderedCollection, error)
GetFollowersByUsername returns an OrderedCollection of Follower IDs.
func (*Datastore) GetFollowingByUsername ¶
func (d *Datastore) GetFollowingByUsername(ctx context.Context, username string) (vocab.ActivityStreamsOrderedCollection, error)
GetFollowingByUsername returns an OrderedCollection of Following IDs.
func (*Datastore) GetLikeStatus ¶
func (*Datastore) GetLikedAsOrderedCollection ¶
func (d *Datastore) GetLikedAsOrderedCollection(ctx context.Context, username string) (vocab.ActivityStreamsOrderedCollection, error)
GetLikedAsOrderedCollection returns an OrderedCollection of Like Activities.
func (*Datastore) GetLikesAsOrderedCollection ¶
func (d *Datastore) GetLikesAsOrderedCollection(ctx context.Context, activityID *url.URL) (vocab.ActivityStreamsOrderedCollection, error)
GetLikesAsOrderedCollection returns all known likes of an ObjectID.
func (*Datastore) GetLikesUsingObjectID ¶
func (d *Datastore) GetLikesUsingObjectID(ctx context.Context, activityID string) (vocab.ActivityStreamsOrderedCollection, error)
GetLikesUsingObjectID returns an OrderedCollection of Like Activities.
func (*Datastore) GetNotificationsInbox ¶
func (d *Datastore) GetNotificationsInbox(ctx context.Context, username, minID, maxID string) (vocab.ActivityStreamsOrderedCollectionPage, error)
GetNotificationsInbox paginates the inbox 20 activities at a time using IDs. ObjectIDs exceeding that maxID are ignored, and ObjectIDs under the min ID are ignored.
func (*Datastore) GetNotificationsInboxAsOrderedCollection ¶
func (d *Datastore) GetNotificationsInboxAsOrderedCollection(ctx context.Context, username string) (vocab.ActivityStreamsOrderedCollection, error)
GetNotificationsInboxAsOrderedCollection returns Likes and Invites.
func (*Datastore) GetPublicInbox ¶
func (d *Datastore) GetPublicInbox(ctx context.Context, minID string, maxID string, local bool, institute bool) (vocab.ActivityStreamsOrderedCollectionPage, error)
GetPublicInbox paginates the inbox 20 activities at a time using IDs. ObjectIDs exceeding that maxID are ignored, and ObjectIDs under the min ID are ignored.
func (*Datastore) GetPublicInboxAsOrderedCollection ¶
func (d *Datastore) GetPublicInboxAsOrderedCollection(ctx context.Context, local bool, institute bool) (vocab.ActivityStreamsOrderedCollection, error)
GetPublicInboxAsOrderedCollection returns an orderedCollection. This collection is used to traverse the publicInbox collection in Mongo.