From b6fbdc66c1ce1ec61ebfb6fcc0351ea627a1d288 Mon Sep 17 00:00:00 2001 From: tobi <31960611+tsmethurst@users.noreply.github.com> Date: Wed, 22 Feb 2023 16:05:26 +0100 Subject: [chore] Deinterface processor and subprocessors (#1501) * [chore] Deinterface processor and subprocessors * expose subprocessors via function calls * missing license header --- internal/api/client/streaming/stream.go | 4 ++-- internal/api/client/streaming/streaming.go | 4 ++-- internal/api/client/streaming/streaming_test.go | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'internal/api/client/streaming') diff --git a/internal/api/client/streaming/stream.go b/internal/api/client/streaming/stream.go index a03f36d16..444157c1b 100644 --- a/internal/api/client/streaming/stream.go +++ b/internal/api/client/streaming/stream.go @@ -154,13 +154,13 @@ func (m *Module) StreamGETHandler(c *gin.Context) { } } - account, errWithCode := m.processor.AuthorizeStreamingRequest(c.Request.Context(), token) + account, errWithCode := m.processor.Stream().Authorize(c.Request.Context(), token) if errWithCode != nil { apiutil.ErrorHandler(c, errWithCode, m.processor.InstanceGetV1) return } - stream, errWithCode := m.processor.OpenStreamForAccount(c.Request.Context(), account, streamType) + stream, errWithCode := m.processor.Stream().Open(c.Request.Context(), account, streamType) if errWithCode != nil { apiutil.ErrorHandler(c, errWithCode, m.processor.InstanceGetV1) return diff --git a/internal/api/client/streaming/streaming.go b/internal/api/client/streaming/streaming.go index d4c61f7a0..1c755a2ca 100644 --- a/internal/api/client/streaming/streaming.go +++ b/internal/api/client/streaming/streaming.go @@ -42,12 +42,12 @@ const ( ) type Module struct { - processor processing.Processor + processor *processing.Processor dTicker time.Duration wsUpgrade websocket.Upgrader } -func New(processor processing.Processor, dTicker time.Duration, wsBuf int) *Module { +func New(processor *processing.Processor, dTicker time.Duration, wsBuf int) *Module { return &Module{ processor: processor, dTicker: dTicker, diff --git a/internal/api/client/streaming/streaming_test.go b/internal/api/client/streaming/streaming_test.go index f713607bb..5fb470af8 100644 --- a/internal/api/client/streaming/streaming_test.go +++ b/internal/api/client/streaming/streaming_test.go @@ -54,7 +54,7 @@ type StreamingTestSuite struct { mediaManager media.Manager federator federation.Federator emailSender email.Sender - processor processing.Processor + processor *processing.Processor storage *storage.Driver // standard suite models -- cgit v1.2.3