summaryrefslogtreecommitdiff
path: root/internal/federation/federation.go
diff options
context:
space:
mode:
authorLibravatar tsmethurst <tobi.smethurst@klarrio.com>2021-03-09 17:03:40 +0100
committerLibravatar tsmethurst <tobi.smethurst@klarrio.com>2021-03-09 17:03:40 +0100
commit9a79d176c91de59a409d06efc8837c1d8f38b5c0 (patch)
treef4582b8eb2f57cfa356b593420308a462a2811db /internal/federation/federation.go
parentadd note struct (diff)
downloadgotosocial-9a79d176c91de59a409d06efc8837c1d8f38b5c0.tar.xz
moving stuff around, stubbing interfaces
Diffstat (limited to 'internal/federation/federation.go')
-rw-r--r--internal/federation/federation.go34
1 files changed, 17 insertions, 17 deletions
diff --git a/internal/federation/federation.go b/internal/federation/federation.go
index dd75fa506..ebc9102b0 100644
--- a/internal/federation/federation.go
+++ b/internal/federation/federation.go
@@ -31,82 +31,82 @@ import (
)
func New(db db.DB) pub.FederatingActor {
- fs := &FederationService{}
- return pub.NewFederatingActor(fs, fs, db, fs)
+ fa := &API{}
+ return pub.NewFederatingActor(fa, fa, db, fa)
}
-type FederationService struct {
+type API struct {
}
// AuthenticateGetInbox determines whether the request is for a GET call to the Actor's Inbox.
-func (fs *FederationService) AuthenticateGetInbox(ctx context.Context, w http.ResponseWriter, r *http.Request) (context.Context, bool, error) {
+func (fa *API) AuthenticateGetInbox(ctx context.Context, w http.ResponseWriter, r *http.Request) (context.Context, bool, error) {
// TODO
return nil, false, nil
}
// AuthenticateGetOutbox determines whether the request is for a GET call to the Actor's Outbox.
-func (fs *FederationService) AuthenticateGetOutbox(ctx context.Context, w http.ResponseWriter, r *http.Request) (context.Context, bool, error) {
+func (fa *API) AuthenticateGetOutbox(ctx context.Context, w http.ResponseWriter, r *http.Request) (context.Context, bool, error) {
// TODO
return nil, false, nil
}
// GetOutbox returns a proper paginated view of the Outbox for serving in a response.
-func (fs *FederationService) GetOutbox(ctx context.Context, r *http.Request) (vocab.ActivityStreamsOrderedCollectionPage, error) {
+func (fa *API) GetOutbox(ctx context.Context, r *http.Request) (vocab.ActivityStreamsOrderedCollectionPage, error) {
// TODO
return nil, nil
}
// NewTransport returns a new pub.Transport for federating with peer software.
-func (fs *FederationService) NewTransport(ctx context.Context, actorBoxIRI *url.URL, gofedAgent string) (pub.Transport, error) {
+func (fa *API) NewTransport(ctx context.Context, actorBoxIRI *url.URL, gofedAgent string) (pub.Transport, error) {
// TODO
return nil, nil
}
-func (fs *FederationService) PostInboxRequestBodyHook(ctx context.Context, r *http.Request, activity pub.Activity) (context.Context, error) {
+func (fa *API) PostInboxRequestBodyHook(ctx context.Context, r *http.Request, activity pub.Activity) (context.Context, error) {
// TODO
return nil, nil
}
-func (fs *FederationService) AuthenticatePostInbox(ctx context.Context, w http.ResponseWriter, r *http.Request) (context.Context, bool, error) {
+func (fa *API) AuthenticatePostInbox(ctx context.Context, w http.ResponseWriter, r *http.Request) (context.Context, bool, error) {
// TODO
return nil, false, nil
}
-func (fs *FederationService) Blocked(ctx context.Context, actorIRIs []*url.URL) (bool, error) {
+func (fa *API) Blocked(ctx context.Context, actorIRIs []*url.URL) (bool, error) {
// TODO
return false, nil
}
-func (fs *FederationService) FederatingCallbacks(ctx context.Context) (pub.FederatingWrappedCallbacks, []interface{}, error) {
+func (fa *API) FederatingCallbacks(ctx context.Context) (pub.FederatingWrappedCallbacks, []interface{}, error) {
// TODO
return pub.FederatingWrappedCallbacks{}, nil, nil
}
-func (fs *FederationService) DefaultCallback(ctx context.Context, activity pub.Activity) error {
+func (fa *API) DefaultCallback(ctx context.Context, activity pub.Activity) error {
// TODO
return nil
}
-func (fs *FederationService) MaxInboxForwardingRecursionDepth(ctx context.Context) int {
+func (fa *API) MaxInboxForwardingRecursionDepth(ctx context.Context) int {
// TODO
return 0
}
-func (fs *FederationService) MaxDeliveryRecursionDepth(ctx context.Context) int {
+func (fa *API) MaxDeliveryRecursionDepth(ctx context.Context) int {
// TODO
return 0
}
-func (fs *FederationService) FilterForwarding(ctx context.Context, potentialRecipients []*url.URL, a pub.Activity) ([]*url.URL, error) {
+func (fa *API) FilterForwarding(ctx context.Context, potentialRecipients []*url.URL, a pub.Activity) ([]*url.URL, error) {
// TODO
return nil, nil
}
-func (fs *FederationService) GetInbox(ctx context.Context, r *http.Request) (vocab.ActivityStreamsOrderedCollectionPage, error) {
+func (fa *API) GetInbox(ctx context.Context, r *http.Request) (vocab.ActivityStreamsOrderedCollectionPage, error) {
// TODO
return nil, nil
}
-func (fs *FederationService) Now() time.Time {
+func (fa *API) Now() time.Time {
return time.Now()
}