go-fed / activity

ActivityStreams & ActivityPub in golang, oh my!
BSD 3-Clause "New" or "Revised" License
702 stars 111 forks source link

Inbox for actor #153

Closed tsmethurst closed 2 years ago

tsmethurst commented 2 years ago

This pull request adds an extra function to the federating database interface: InboxForActor.

The idea of this function is to cut down on remote dereferencing calls by offering implementers the opportunity to return the Inbox of an Actor directly from the database rather than making remote calls to obtain the Actor's inbox IRI.

For implementers who don't want to use this functionality, they can simply return nil, nil from this function, and the previous behavior of go-fed will be triggered instead.

Note 1: I'm not sure how to run tests against this repo, so this PR isn't tested yet. Note 2: I didn't find any instructions for generating mocks, so I used https://github.com/golang/mock v1.6.0 to regenerate the mock database interface for tests.

cjslep commented 2 years ago

Thanks for this!