persistence

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddFollow

func AddFollow(follow apmodels.ActivityPubActor, approved bool) error

AddFollow will save a follow to the datastore.

func AddToOutbox

func AddToOutbox(iri string, itemData []byte, typeString string, isLiveNotification bool) error

AddToOutbox will store a single payload to the persistence layer.

func ApprovePreviousFollowRequest

func ApprovePreviousFollowRequest(iri string) error

ApprovePreviousFollowRequest will approve a follow request.

func BlockOrRejectFollower

func BlockOrRejectFollower(iri string) error

BlockOrRejectFollower will block an existing follower or reject a follow request.

func GetBlockedAndRejectedFollowers

func GetBlockedAndRejectedFollowers() ([]models.Follower, error)

GetBlockedAndRejectedFollowers will return blocked and rejected followers.

func GetFederationFollowers

func GetFederationFollowers(limit int, offset int) ([]models.Follower, int, error)

GetFederationFollowers will return a slice of the followers we keep track of locally.

func GetFollower

func GetFollower(iri string) (*apmodels.ActivityPubActor, error)

GetFollower will return a single follower/request given an IRI.

func GetFollowerCount

func GetFollowerCount() (int64, error)

GetFollowerCount will return the number of followers we're keeping track of.

func GetInboundActivities

func GetInboundActivities(limit int, offset int) ([]models.FederatedActivity, int, error)

GetInboundActivities will return a collection of saved, federated activities limited and offset by the values provided to support pagination.

func GetLocalPostCount

func GetLocalPostCount() (int64, error)

GetLocalPostCount will return the number of posts existing locally.

func GetObjectByIRI

func GetObjectByIRI(iri string) (string, bool, time.Time, error)

GetObjectByIRI will return a string representation of a single object by the IRI.

func GetOutbox

func GetOutbox(limit int, offset int) (vocab.ActivityStreamsOrderedCollection, error)

GetOutbox will return an instance of the outbox populated by stored items.

func GetOutboxPostCount

func GetOutboxPostCount() (int64, error)

GetOutboxPostCount will return the number of posts in the outbox.

func GetPendingFollowRequests

func GetPendingFollowRequests() ([]models.Follower, error)

GetPendingFollowRequests will return pending follow requests.

func HasPreviouslyHandledInboundActivity

func HasPreviouslyHandledInboundActivity(iri string, actorIRI string, eventType string) (bool, error)

HasPreviouslyHandledInboundActivity will return if we have previously handled an inbound federated activity.

func RemoveFollow

func RemoveFollow(unfollow apmodels.ActivityPubActor) error

RemoveFollow will remove a follow from the datastore.

func SaveInboundFediverseActivity

func SaveInboundFediverseActivity(objectIRI string, actorIRI string, eventType string, timestamp time.Time) error

SaveInboundFediverseActivity will save an event to the ap_inbound_activities table.

func Setup

func Setup(datastore *data.Datastore)

Setup will initialize the ActivityPub persistence layer with the provided datastore.

func UpdateFollower

func UpdateFollower(actorIRI string, inbox string, name string, username string, image string) error

UpdateFollower will update the details of a stored follower given an IRI.

Types

This section is empty.

Jump to

Keyboard shortcuts

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