summaryrefslogtreecommitdiff
path: root/internal/processing/synchronous/streaming/streaming.go
diff options
context:
space:
mode:
authorLibravatar Tobi Smethurst <31960611+tsmethurst@users.noreply.github.com>2021-07-05 13:23:03 +0200
committerLibravatar GitHub <noreply@github.com>2021-07-05 13:23:03 +0200
commitd389e7b150df6ecd215c7b661b294ea153ad0103 (patch)
tree8739e3103cb5130875d903cc7fc72fd9db3b8434 /internal/processing/synchronous/streaming/streaming.go
parentFix 404 contact (#74) (diff)
downloadgotosocial-d389e7b150df6ecd215c7b661b294ea153ad0103.tar.xz
Domain block (#76)
* start work on admin domain blocking * move stuff around + further work on domain blocks * move + restructure processor * prep work for deleting account * tidy * go fmt * formatting * domain blocking more work * check domain blocks way earlier on * progress on delete account * delete more stuff when an account is gone * and more... * domain blocky block block * get individual domain block, delete a block
Diffstat (limited to 'internal/processing/synchronous/streaming/streaming.go')
-rw-r--r--internal/processing/synchronous/streaming/streaming.go52
1 files changed, 0 insertions, 52 deletions
diff --git a/internal/processing/synchronous/streaming/streaming.go b/internal/processing/synchronous/streaming/streaming.go
deleted file mode 100644
index de75b8f27..000000000
--- a/internal/processing/synchronous/streaming/streaming.go
+++ /dev/null
@@ -1,52 +0,0 @@
-package streaming
-
-import (
- "sync"
-
- "github.com/sirupsen/logrus"
- apimodel "github.com/superseriousbusiness/gotosocial/internal/api/model"
- "github.com/superseriousbusiness/gotosocial/internal/config"
- "github.com/superseriousbusiness/gotosocial/internal/db"
- "github.com/superseriousbusiness/gotosocial/internal/gtserror"
- "github.com/superseriousbusiness/gotosocial/internal/gtsmodel"
- "github.com/superseriousbusiness/gotosocial/internal/oauth"
- "github.com/superseriousbusiness/gotosocial/internal/typeutils"
- "github.com/superseriousbusiness/gotosocial/internal/visibility"
-)
-
-// Processor wraps a bunch of functions for processing streaming.
-type Processor interface {
- // AuthorizeStreamingRequest returns an oauth2 token info in response to an access token query from the streaming API
- AuthorizeStreamingRequest(accessToken string) (*gtsmodel.Account, error)
- // OpenStreamForAccount returns a new Stream for the given account, which will contain a channel for passing messages back to the caller.
- OpenStreamForAccount(account *gtsmodel.Account, streamType string) (*gtsmodel.Stream, gtserror.WithCode)
- // StreamStatusToAccount streams the given status to any open, appropriate streams belonging to the given account.
- StreamStatusToAccount(s *apimodel.Status, account *gtsmodel.Account) error
- // StreamNotificationToAccount streams the given notification to any open, appropriate streams belonging to the given account.
- StreamNotificationToAccount(n *apimodel.Notification, account *gtsmodel.Account) error
- // StreamDelete streams the delete of the given statusID to *ALL* open streams.
- StreamDelete(statusID string) error
-}
-
-type processor struct {
- tc typeutils.TypeConverter
- config *config.Config
- db db.DB
- filter visibility.Filter
- log *logrus.Logger
- oauthServer oauth.Server
- streamMap *sync.Map
-}
-
-// New returns a new status processor.
-func New(db db.DB, tc typeutils.TypeConverter, oauthServer oauth.Server, config *config.Config, log *logrus.Logger) Processor {
- return &processor{
- tc: tc,
- config: config,
- db: db,
- filter: visibility.NewFilter(db, log),
- log: log,
- oauthServer: oauthServer,
- streamMap: &sync.Map{},
- }
-}