[chore] Deinterface processor and subprocessors (#1501)

* [chore] Deinterface processor and subprocessors

* expose subprocessors via function calls

* missing license header
This commit is contained in:
tobi 2023-02-22 16:05:26 +01:00 committed by GitHub
commit b6fbdc66c1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
246 changed files with 2545 additions and 4549 deletions

View file

@ -35,10 +35,10 @@ const (
)
type Module struct {
processor processing.Processor
processor *processing.Processor
}
func New(processor processing.Processor) *Module {
func New(processor *processing.Processor) *Module {
return &Module{
processor: processor,
}

View file

@ -123,7 +123,7 @@ func (m *Module) MediaCreatePOSTHandler(c *gin.Context) {
return
}
apiAttachment, errWithCode := m.processor.MediaCreate(c.Request.Context(), authed, form)
apiAttachment, errWithCode := m.processor.Media().Create(c.Request.Context(), authed.Account, form)
if errWithCode != nil {
apiutil.ErrorHandler(c, errWithCode, m.processor.InstanceGetV1)
return

View file

@ -59,7 +59,7 @@ type MediaCreateTestSuite struct {
tc typeutils.TypeConverter
oauthServer oauth.Server
emailSender email.Sender
processor processing.Processor
processor *processing.Processor
// standard suite models
testTokens map[string]*gtsmodel.Token

View file

@ -91,7 +91,7 @@ func (m *Module) MediaGETHandler(c *gin.Context) {
return
}
attachment, errWithCode := m.processor.MediaGet(c.Request.Context(), authed, attachmentID)
attachment, errWithCode := m.processor.Media().Get(c.Request.Context(), authed.Account, attachmentID)
if errWithCode != nil {
apiutil.ErrorHandler(c, errWithCode, m.processor.InstanceGetV1)
return

View file

@ -134,7 +134,7 @@ func (m *Module) MediaPUTHandler(c *gin.Context) {
return
}
attachment, errWithCode := m.processor.MediaUpdate(c.Request.Context(), authed, attachmentID, form)
attachment, errWithCode := m.processor.Media().Update(c.Request.Context(), authed.Account, attachmentID, form)
if errWithCode != nil {
apiutil.ErrorHandler(c, errWithCode, m.processor.InstanceGetV1)
return

View file

@ -57,7 +57,7 @@ type MediaUpdateTestSuite struct {
mediaManager media.Manager
oauthServer oauth.Server
emailSender email.Sender
processor processing.Processor
processor *processing.Processor
// standard suite models
testTokens map[string]*gtsmodel.Token