diff --git a/mocks/internal/action/GTSAction.go b/internal/action/mock_GTSAction.go similarity index 71% rename from mocks/internal/action/GTSAction.go rename to internal/action/mock_GTSAction.go index a8a1204..dbc8375 100644 --- a/mocks/internal/action/GTSAction.go +++ b/internal/action/mock_GTSAction.go @@ -1,6 +1,6 @@ // Code generated by mockery v2.7.4. DO NOT EDIT. -package mocks +package action import ( context "context" @@ -12,13 +12,13 @@ import ( mock "github.com/stretchr/testify/mock" ) -// GTSAction is an autogenerated mock type for the GTSAction type -type GTSAction struct { +// MockGTSAction is an autogenerated mock type for the GTSAction type +type MockGTSAction struct { mock.Mock } // Execute provides a mock function with given fields: _a0, _a1, _a2 -func (_m *GTSAction) Execute(_a0 context.Context, _a1 *config.Config, _a2 *logrus.Logger) error { +func (_m *MockGTSAction) Execute(_a0 context.Context, _a1 *config.Config, _a2 *logrus.Logger) error { ret := _m.Called(_a0, _a1, _a2) var r0 error diff --git a/mocks/internal/cache/Cache.go b/internal/cache/mock_Cache.go similarity index 76% rename from mocks/internal/cache/Cache.go rename to internal/cache/mock_Cache.go index ddec2de..d8d18d6 100644 --- a/mocks/internal/cache/Cache.go +++ b/internal/cache/mock_Cache.go @@ -1,16 +1,16 @@ // Code generated by mockery v2.7.4. DO NOT EDIT. -package mocks +package cache import mock "github.com/stretchr/testify/mock" -// Cache is an autogenerated mock type for the Cache type -type Cache struct { +// MockCache is an autogenerated mock type for the Cache type +type MockCache struct { mock.Mock } // Fetch provides a mock function with given fields: k -func (_m *Cache) Fetch(k string) (interface{}, error) { +func (_m *MockCache) Fetch(k string) (interface{}, error) { ret := _m.Called(k) var r0 interface{} @@ -33,7 +33,7 @@ func (_m *Cache) Fetch(k string) (interface{}, error) { } // Store provides a mock function with given fields: k, v -func (_m *Cache) Store(k string, v interface{}) error { +func (_m *MockCache) Store(k string, v interface{}) error { ret := _m.Called(k, v) var r0 error diff --git a/mocks/internal/config/KeyedFlags.go b/internal/config/mock_KeyedFlags.go similarity index 75% rename from mocks/internal/config/KeyedFlags.go rename to internal/config/mock_KeyedFlags.go index a6022b0..95057d1 100644 --- a/mocks/internal/config/KeyedFlags.go +++ b/internal/config/mock_KeyedFlags.go @@ -1,16 +1,16 @@ // Code generated by mockery v2.7.4. DO NOT EDIT. -package mocks +package config import mock "github.com/stretchr/testify/mock" -// KeyedFlags is an autogenerated mock type for the KeyedFlags type -type KeyedFlags struct { +// MockKeyedFlags is an autogenerated mock type for the KeyedFlags type +type MockKeyedFlags struct { mock.Mock } // Bool provides a mock function with given fields: k -func (_m *KeyedFlags) Bool(k string) bool { +func (_m *MockKeyedFlags) Bool(k string) bool { ret := _m.Called(k) var r0 bool @@ -24,7 +24,7 @@ func (_m *KeyedFlags) Bool(k string) bool { } // Int provides a mock function with given fields: k -func (_m *KeyedFlags) Int(k string) int { +func (_m *MockKeyedFlags) Int(k string) int { ret := _m.Called(k) var r0 int @@ -38,7 +38,7 @@ func (_m *KeyedFlags) Int(k string) int { } // IsSet provides a mock function with given fields: k -func (_m *KeyedFlags) IsSet(k string) bool { +func (_m *MockKeyedFlags) IsSet(k string) bool { ret := _m.Called(k) var r0 bool @@ -52,7 +52,7 @@ func (_m *KeyedFlags) IsSet(k string) bool { } // String provides a mock function with given fields: k -func (_m *KeyedFlags) String(k string) string { +func (_m *MockKeyedFlags) String(k string) string { ret := _m.Called(k) var r0 string diff --git a/mocks/internal/db/DB.go b/internal/db/mock_DB.go similarity index 78% rename from mocks/internal/db/DB.go rename to internal/db/mock_DB.go index dbf8120..8bf52e3 100644 --- a/mocks/internal/db/DB.go +++ b/internal/db/mock_DB.go @@ -1,13 +1,12 @@ // Code generated by mockery v2.7.4. DO NOT EDIT. -package mocks +package db import ( context "context" - mastotypes "github.com/superseriousbusiness/gotosocial/pkg/mastotypes" - mock "github.com/stretchr/testify/mock" + mastotypes "github.com/superseriousbusiness/gotosocial/pkg/mastotypes" model "github.com/superseriousbusiness/gotosocial/internal/db/model" @@ -16,13 +15,13 @@ import ( pub "github.com/go-fed/activity/pub" ) -// DB is an autogenerated mock type for the DB type -type DB struct { +// MockDB is an autogenerated mock type for the DB type +type MockDB struct { mock.Mock } // AccountToMastoSensitive provides a mock function with given fields: account -func (_m *DB) AccountToMastoSensitive(account *model.Account) (*mastotypes.Account, error) { +func (_m *MockDB) AccountToMastoSensitive(account *model.Account) (*mastotypes.Account, error) { ret := _m.Called(account) var r0 *mastotypes.Account @@ -45,7 +44,7 @@ func (_m *DB) AccountToMastoSensitive(account *model.Account) (*mastotypes.Accou } // CreateTable provides a mock function with given fields: i -func (_m *DB) CreateTable(i interface{}) error { +func (_m *MockDB) CreateTable(i interface{}) error { ret := _m.Called(i) var r0 error @@ -59,7 +58,7 @@ func (_m *DB) CreateTable(i interface{}) error { } // DeleteByID provides a mock function with given fields: id, i -func (_m *DB) DeleteByID(id string, i interface{}) error { +func (_m *MockDB) DeleteByID(id string, i interface{}) error { ret := _m.Called(id, i) var r0 error @@ -73,7 +72,7 @@ func (_m *DB) DeleteByID(id string, i interface{}) error { } // DeleteWhere provides a mock function with given fields: key, value, i -func (_m *DB) DeleteWhere(key string, value interface{}, i interface{}) error { +func (_m *MockDB) DeleteWhere(key string, value interface{}, i interface{}) error { ret := _m.Called(key, value, i) var r0 error @@ -87,7 +86,7 @@ func (_m *DB) DeleteWhere(key string, value interface{}, i interface{}) error { } // DropTable provides a mock function with given fields: i -func (_m *DB) DropTable(i interface{}) error { +func (_m *MockDB) DropTable(i interface{}) error { ret := _m.Called(i) var r0 error @@ -101,7 +100,7 @@ func (_m *DB) DropTable(i interface{}) error { } // Federation provides a mock function with given fields: -func (_m *DB) Federation() pub.Database { +func (_m *MockDB) Federation() pub.Database { ret := _m.Called() var r0 pub.Database @@ -117,7 +116,7 @@ func (_m *DB) Federation() pub.Database { } // GetAccountByUserID provides a mock function with given fields: userID, account -func (_m *DB) GetAccountByUserID(userID string, account *model.Account) error { +func (_m *MockDB) GetAccountByUserID(userID string, account *model.Account) error { ret := _m.Called(userID, account) var r0 error @@ -131,7 +130,7 @@ func (_m *DB) GetAccountByUserID(userID string, account *model.Account) error { } // GetAll provides a mock function with given fields: i -func (_m *DB) GetAll(i interface{}) error { +func (_m *MockDB) GetAll(i interface{}) error { ret := _m.Called(i) var r0 error @@ -145,7 +144,7 @@ func (_m *DB) GetAll(i interface{}) error { } // GetByID provides a mock function with given fields: id, i -func (_m *DB) GetByID(id string, i interface{}) error { +func (_m *MockDB) GetByID(id string, i interface{}) error { ret := _m.Called(id, i) var r0 error @@ -159,7 +158,7 @@ func (_m *DB) GetByID(id string, i interface{}) error { } // GetFollowersByAccountID provides a mock function with given fields: accountID, followers -func (_m *DB) GetFollowersByAccountID(accountID string, followers *[]model.Follow) error { +func (_m *MockDB) GetFollowersByAccountID(accountID string, followers *[]model.Follow) error { ret := _m.Called(accountID, followers) var r0 error @@ -173,7 +172,7 @@ func (_m *DB) GetFollowersByAccountID(accountID string, followers *[]model.Follo } // GetFollowingByAccountID provides a mock function with given fields: accountID, following -func (_m *DB) GetFollowingByAccountID(accountID string, following *[]model.Follow) error { +func (_m *MockDB) GetFollowingByAccountID(accountID string, following *[]model.Follow) error { ret := _m.Called(accountID, following) var r0 error @@ -187,7 +186,7 @@ func (_m *DB) GetFollowingByAccountID(accountID string, following *[]model.Follo } // GetLastStatusForAccountID provides a mock function with given fields: accountID, status -func (_m *DB) GetLastStatusForAccountID(accountID string, status *model.Status) error { +func (_m *MockDB) GetLastStatusForAccountID(accountID string, status *model.Status) error { ret := _m.Called(accountID, status) var r0 error @@ -201,7 +200,7 @@ func (_m *DB) GetLastStatusForAccountID(accountID string, status *model.Status) } // GetStatusesByAccountID provides a mock function with given fields: accountID, statuses -func (_m *DB) GetStatusesByAccountID(accountID string, statuses *[]model.Status) error { +func (_m *MockDB) GetStatusesByAccountID(accountID string, statuses *[]model.Status) error { ret := _m.Called(accountID, statuses) var r0 error @@ -215,7 +214,7 @@ func (_m *DB) GetStatusesByAccountID(accountID string, statuses *[]model.Status) } // GetStatusesByTimeDescending provides a mock function with given fields: accountID, statuses, limit -func (_m *DB) GetStatusesByTimeDescending(accountID string, statuses *[]model.Status, limit int) error { +func (_m *MockDB) GetStatusesByTimeDescending(accountID string, statuses *[]model.Status, limit int) error { ret := _m.Called(accountID, statuses, limit) var r0 error @@ -229,7 +228,7 @@ func (_m *DB) GetStatusesByTimeDescending(accountID string, statuses *[]model.St } // GetWhere provides a mock function with given fields: key, value, i -func (_m *DB) GetWhere(key string, value interface{}, i interface{}) error { +func (_m *MockDB) GetWhere(key string, value interface{}, i interface{}) error { ret := _m.Called(key, value, i) var r0 error @@ -243,7 +242,7 @@ func (_m *DB) GetWhere(key string, value interface{}, i interface{}) error { } // IsEmailAvailable provides a mock function with given fields: email -func (_m *DB) IsEmailAvailable(email string) error { +func (_m *MockDB) IsEmailAvailable(email string) error { ret := _m.Called(email) var r0 error @@ -257,7 +256,7 @@ func (_m *DB) IsEmailAvailable(email string) error { } // IsHealthy provides a mock function with given fields: ctx -func (_m *DB) IsHealthy(ctx context.Context) error { +func (_m *MockDB) IsHealthy(ctx context.Context) error { ret := _m.Called(ctx) var r0 error @@ -271,7 +270,7 @@ func (_m *DB) IsHealthy(ctx context.Context) error { } // IsUsernameAvailable provides a mock function with given fields: username -func (_m *DB) IsUsernameAvailable(username string) error { +func (_m *MockDB) IsUsernameAvailable(username string) error { ret := _m.Called(username) var r0 error @@ -285,7 +284,7 @@ func (_m *DB) IsUsernameAvailable(username string) error { } // NewSignup provides a mock function with given fields: username, reason, requireApproval, email, password, signUpIP, locale -func (_m *DB) NewSignup(username string, reason string, requireApproval bool, email string, password string, signUpIP net.IP, locale string) (*model.User, error) { +func (_m *MockDB) NewSignup(username string, reason string, requireApproval bool, email string, password string, signUpIP net.IP, locale string) (*model.User, error) { ret := _m.Called(username, reason, requireApproval, email, password, signUpIP, locale) var r0 *model.User @@ -308,7 +307,7 @@ func (_m *DB) NewSignup(username string, reason string, requireApproval bool, em } // Put provides a mock function with given fields: i -func (_m *DB) Put(i interface{}) error { +func (_m *MockDB) Put(i interface{}) error { ret := _m.Called(i) var r0 error @@ -322,7 +321,7 @@ func (_m *DB) Put(i interface{}) error { } // Stop provides a mock function with given fields: ctx -func (_m *DB) Stop(ctx context.Context) error { +func (_m *MockDB) Stop(ctx context.Context) error { ret := _m.Called(ctx) var r0 error @@ -336,7 +335,7 @@ func (_m *DB) Stop(ctx context.Context) error { } // UpdateByID provides a mock function with given fields: id, i -func (_m *DB) UpdateByID(id string, i interface{}) error { +func (_m *MockDB) UpdateByID(id string, i interface{}) error { ret := _m.Called(id, i) var r0 error diff --git a/mocks/internal/distributor/Distributor.go b/internal/distributor/mock_Distributor.go similarity index 75% rename from mocks/internal/distributor/Distributor.go rename to internal/distributor/mock_Distributor.go index 0dda093..93d7dd8 100644 --- a/mocks/internal/distributor/Distributor.go +++ b/internal/distributor/mock_Distributor.go @@ -1,16 +1,16 @@ // Code generated by mockery v2.7.4. DO NOT EDIT. -package mocks +package distributor import mock "github.com/stretchr/testify/mock" -// Distributor is an autogenerated mock type for the Distributor type -type Distributor struct { +// MockDistributor is an autogenerated mock type for the Distributor type +type MockDistributor struct { mock.Mock } // ClientAPIIn provides a mock function with given fields: -func (_m *Distributor) ClientAPIIn() chan interface{} { +func (_m *MockDistributor) ClientAPIIn() chan interface{} { ret := _m.Called() var r0 chan interface{} @@ -26,7 +26,7 @@ func (_m *Distributor) ClientAPIIn() chan interface{} { } // ClientAPIOut provides a mock function with given fields: -func (_m *Distributor) ClientAPIOut() chan interface{} { +func (_m *MockDistributor) ClientAPIOut() chan interface{} { ret := _m.Called() var r0 chan interface{} @@ -42,7 +42,7 @@ func (_m *Distributor) ClientAPIOut() chan interface{} { } // Start provides a mock function with given fields: -func (_m *Distributor) Start() error { +func (_m *MockDistributor) Start() error { ret := _m.Called() var r0 error @@ -56,7 +56,7 @@ func (_m *Distributor) Start() error { } // Stop provides a mock function with given fields: -func (_m *Distributor) Stop() error { +func (_m *MockDistributor) Stop() error { ret := _m.Called() var r0 error diff --git a/mocks/internal/gotosocial/Gotosocial.go b/internal/gotosocial/mock_Gotosocial.go similarity index 66% rename from mocks/internal/gotosocial/Gotosocial.go rename to internal/gotosocial/mock_Gotosocial.go index 295837f..8aca69b 100644 --- a/mocks/internal/gotosocial/Gotosocial.go +++ b/internal/gotosocial/mock_Gotosocial.go @@ -1,6 +1,6 @@ // Code generated by mockery v2.7.4. DO NOT EDIT. -package mocks +package gotosocial import ( context "context" @@ -8,13 +8,13 @@ import ( mock "github.com/stretchr/testify/mock" ) -// Gotosocial is an autogenerated mock type for the Gotosocial type -type Gotosocial struct { +// MockGotosocial is an autogenerated mock type for the Gotosocial type +type MockGotosocial struct { mock.Mock } // Start provides a mock function with given fields: _a0 -func (_m *Gotosocial) Start(_a0 context.Context) error { +func (_m *MockGotosocial) Start(_a0 context.Context) error { ret := _m.Called(_a0) var r0 error diff --git a/mocks/internal/media/API.go b/internal/media/mock_API.go similarity index 54% rename from mocks/internal/media/API.go rename to internal/media/mock_API.go index b892669..bceede3 100644 --- a/mocks/internal/media/API.go +++ b/internal/media/mock_API.go @@ -1,10 +1,10 @@ // Code generated by mockery v2.7.4. DO NOT EDIT. -package mocks +package media import mock "github.com/stretchr/testify/mock" -// API is an autogenerated mock type for the API type -type API struct { +// MockAPI is an autogenerated mock type for the API type +type MockAPI struct { mock.Mock } diff --git a/mocks/internal/module/ClientAPIModule.go b/internal/module/mock_ClientAPIModule.go similarity index 67% rename from mocks/internal/module/ClientAPIModule.go rename to internal/module/mock_ClientAPIModule.go index 614d680..55fca05 100644 --- a/mocks/internal/module/ClientAPIModule.go +++ b/internal/module/mock_ClientAPIModule.go @@ -1,20 +1,19 @@ // Code generated by mockery v2.7.4. DO NOT EDIT. -package mocks +package module import ( mock "github.com/stretchr/testify/mock" - router "github.com/superseriousbusiness/gotosocial/internal/router" ) -// ClientAPIModule is an autogenerated mock type for the ClientAPIModule type -type ClientAPIModule struct { +// MockClientAPIModule is an autogenerated mock type for the ClientAPIModule type +type MockClientAPIModule struct { mock.Mock } // Route provides a mock function with given fields: s -func (_m *ClientAPIModule) Route(s router.Router) error { +func (_m *MockClientAPIModule) Route(s router.Router) error { ret := _m.Called(s) var r0 error diff --git a/mocks/internal/oauth/Server.go b/internal/oauth/mock_Server.go similarity index 77% rename from mocks/internal/oauth/Server.go rename to internal/oauth/mock_Server.go index 97cd67b..a5c0d60 100644 --- a/mocks/internal/oauth/Server.go +++ b/internal/oauth/mock_Server.go @@ -1,22 +1,21 @@ // Code generated by mockery v2.7.4. DO NOT EDIT. -package mocks +package oauth import ( http "net/http" mock "github.com/stretchr/testify/mock" - oauth2 "github.com/superseriousbusiness/oauth2/v4" ) -// Server is an autogenerated mock type for the Server type -type Server struct { +// MockServer is an autogenerated mock type for the Server type +type MockServer struct { mock.Mock } // GenerateUserAccessToken provides a mock function with given fields: ti, clientSecret, userID -func (_m *Server) GenerateUserAccessToken(ti oauth2.TokenInfo, clientSecret string, userID string) (oauth2.TokenInfo, error) { +func (_m *MockServer) GenerateUserAccessToken(ti oauth2.TokenInfo, clientSecret string, userID string) (oauth2.TokenInfo, error) { ret := _m.Called(ti, clientSecret, userID) var r0 oauth2.TokenInfo @@ -39,7 +38,7 @@ func (_m *Server) GenerateUserAccessToken(ti oauth2.TokenInfo, clientSecret stri } // HandleAuthorizeRequest provides a mock function with given fields: w, r -func (_m *Server) HandleAuthorizeRequest(w http.ResponseWriter, r *http.Request) error { +func (_m *MockServer) HandleAuthorizeRequest(w http.ResponseWriter, r *http.Request) error { ret := _m.Called(w, r) var r0 error @@ -53,7 +52,7 @@ func (_m *Server) HandleAuthorizeRequest(w http.ResponseWriter, r *http.Request) } // HandleTokenRequest provides a mock function with given fields: w, r -func (_m *Server) HandleTokenRequest(w http.ResponseWriter, r *http.Request) error { +func (_m *MockServer) HandleTokenRequest(w http.ResponseWriter, r *http.Request) error { ret := _m.Called(w, r) var r0 error @@ -67,7 +66,7 @@ func (_m *Server) HandleTokenRequest(w http.ResponseWriter, r *http.Request) err } // ValidationBearerToken provides a mock function with given fields: r -func (_m *Server) ValidationBearerToken(r *http.Request) (oauth2.TokenInfo, error) { +func (_m *MockServer) ValidationBearerToken(r *http.Request) (oauth2.TokenInfo, error) { ret := _m.Called(r) var r0 oauth2.TokenInfo diff --git a/mocks/internal/router/Router.go b/internal/router/mock_Router.go similarity index 65% rename from mocks/internal/router/Router.go rename to internal/router/mock_Router.go index c94b8f2..eb8b311 100644 --- a/mocks/internal/router/Router.go +++ b/internal/router/mock_Router.go @@ -1,6 +1,6 @@ // Code generated by mockery v2.7.4. DO NOT EDIT. -package mocks +package router import ( context "context" @@ -9,28 +9,28 @@ import ( mock "github.com/stretchr/testify/mock" ) -// Router is an autogenerated mock type for the Router type -type Router struct { +// MockRouter is an autogenerated mock type for the Router type +type MockRouter struct { mock.Mock } // AttachHandler provides a mock function with given fields: method, path, f -func (_m *Router) AttachHandler(method string, path string, f gin.HandlerFunc) { +func (_m *MockRouter) AttachHandler(method string, path string, f gin.HandlerFunc) { _m.Called(method, path, f) } // AttachMiddleware provides a mock function with given fields: handler -func (_m *Router) AttachMiddleware(handler gin.HandlerFunc) { +func (_m *MockRouter) AttachMiddleware(handler gin.HandlerFunc) { _m.Called(handler) } // Start provides a mock function with given fields: -func (_m *Router) Start() { +func (_m *MockRouter) Start() { _m.Called() } // Stop provides a mock function with given fields: ctx -func (_m *Router) Stop(ctx context.Context) error { +func (_m *MockRouter) Stop(ctx context.Context) error { ret := _m.Called(ctx) var r0 error