streaming working

This commit is contained in:
tsmethurst 2021-06-18 13:06:02 +02:00 committed by tsmethurst
commit a3d3cd8d43
13 changed files with 170 additions and 93 deletions

View file

@ -3,8 +3,8 @@ package streaming
import (
"sync"
"github.com/gorilla/websocket"
"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"
@ -12,15 +12,14 @@ import (
"github.com/superseriousbusiness/gotosocial/internal/oauth"
"github.com/superseriousbusiness/gotosocial/internal/typeutils"
"github.com/superseriousbusiness/gotosocial/internal/visibility"
apimodel "github.com/superseriousbusiness/gotosocial/internal/api/model"
)
// 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(c *websocket.Conn, account *gtsmodel.Account, streamType string) gtserror.WithCode
StreamStatusForAccount(s *apimodel.Status, account *gtsmodel.Account) error
OpenStreamForAccount(account *gtsmodel.Account, streamType string) (*gtsmodel.Stream, gtserror.WithCode)
StreamStatusToAccount(s *apimodel.Status, account *gtsmodel.Account) error
}
type processor struct {