| 
									
										
										
										
											2023-03-12 16:00:57 +01:00
										 |  |  | // GoToSocial | 
					
						
							|  |  |  | // Copyright (C) GoToSocial Authors admin@gotosocial.org | 
					
						
							|  |  |  | // SPDX-License-Identifier: AGPL-3.0-or-later | 
					
						
							|  |  |  | // | 
					
						
							|  |  |  | // This program is free software: you can redistribute it and/or modify | 
					
						
							|  |  |  | // it under the terms of the GNU Affero General Public License as published by | 
					
						
							|  |  |  | // the Free Software Foundation, either version 3 of the License, or | 
					
						
							|  |  |  | // (at your option) any later version. | 
					
						
							|  |  |  | // | 
					
						
							|  |  |  | // This program is distributed in the hope that it will be useful, | 
					
						
							|  |  |  | // but WITHOUT ANY WARRANTY; without even the implied warranty of | 
					
						
							|  |  |  | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
					
						
							|  |  |  | // GNU Affero General Public License for more details. | 
					
						
							|  |  |  | // | 
					
						
							|  |  |  | // You should have received a copy of the GNU Affero General Public License | 
					
						
							|  |  |  | // along with this program.  If not, see <http://www.gnu.org/licenses/>. | 
					
						
							| 
									
										
										
										
											2021-03-13 17:07:05 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-04-19 19:42:19 +02:00
										 |  |  | package testrig | 
					
						
							| 
									
										
										
										
											2021-03-13 17:07:05 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-04-19 19:42:19 +02:00
										 |  |  | import ( | 
					
						
							| 
									
										
										
										
											2025-04-26 15:34:10 +02:00
										 |  |  | 	"code.superseriousbusiness.org/gotosocial/internal/cleaner" | 
					
						
							|  |  |  | 	"code.superseriousbusiness.org/gotosocial/internal/email" | 
					
						
							|  |  |  | 	"code.superseriousbusiness.org/gotosocial/internal/federation" | 
					
						
							|  |  |  | 	"code.superseriousbusiness.org/gotosocial/internal/filter/interaction" | 
					
						
							| 
									
										
										
										
											2025-05-31 17:30:57 +02:00
										 |  |  | 	"code.superseriousbusiness.org/gotosocial/internal/filter/mutes" | 
					
						
							| 
									
										
										
										
											2025-04-26 15:34:10 +02:00
										 |  |  | 	"code.superseriousbusiness.org/gotosocial/internal/filter/visibility" | 
					
						
							|  |  |  | 	"code.superseriousbusiness.org/gotosocial/internal/media" | 
					
						
							|  |  |  | 	"code.superseriousbusiness.org/gotosocial/internal/processing" | 
					
						
							|  |  |  | 	"code.superseriousbusiness.org/gotosocial/internal/state" | 
					
						
							|  |  |  | 	"code.superseriousbusiness.org/gotosocial/internal/subscriptions" | 
					
						
							|  |  |  | 	"code.superseriousbusiness.org/gotosocial/internal/typeutils" | 
					
						
							|  |  |  | 	"code.superseriousbusiness.org/gotosocial/internal/webpush" | 
					
						
							| 
									
										
										
										
											2021-04-19 19:42:19 +02:00
										 |  |  | ) | 
					
						
							| 
									
										
										
										
											2021-03-13 17:07:05 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-11-14 15:57:25 +01:00
										 |  |  | // NewTestProcessor returns a Processor suitable for testing purposes. | 
					
						
							|  |  |  | // The passed in state will have its worker functions set appropriately, | 
					
						
							|  |  |  | // but the state will not be initialized. | 
					
						
							| 
									
										
										
										
											2025-01-08 11:29:40 +01:00
										 |  |  | func NewTestProcessor( | 
					
						
							|  |  |  | 	state *state.State, | 
					
						
							|  |  |  | 	federator *federation.Federator, | 
					
						
							|  |  |  | 	emailSender email.Sender, | 
					
						
							| 
									
										
										
										
											2025-01-23 16:47:30 -08:00
										 |  |  | 	webPushSender webpush.Sender, | 
					
						
							| 
									
										
										
										
											2025-01-08 11:29:40 +01:00
										 |  |  | 	mediaManager *media.Manager, | 
					
						
							|  |  |  | ) *processing.Processor { | 
					
						
							| 
									
										
										
										
											2024-07-24 13:27:42 +02:00
										 |  |  | 	return processing.NewProcessor( | 
					
						
							|  |  |  | 		cleaner.New(state), | 
					
						
							| 
									
										
										
										
											2025-01-08 11:29:40 +01:00
										 |  |  | 		subscriptions.New( | 
					
						
							|  |  |  | 			state, | 
					
						
							|  |  |  | 			federator.TransportController(), | 
					
						
							|  |  |  | 			typeutils.NewConverter(state), | 
					
						
							|  |  |  | 		), | 
					
						
							| 
									
										
										
										
											2024-07-24 13:27:42 +02:00
										 |  |  | 		typeutils.NewConverter(state), | 
					
						
							|  |  |  | 		federator, | 
					
						
							| 
									
										
										
										
											2025-03-03 16:03:36 +01:00
										 |  |  | 		NewTestOauthServer(state), | 
					
						
							| 
									
										
										
										
											2024-07-24 13:27:42 +02:00
										 |  |  | 		mediaManager, | 
					
						
							|  |  |  | 		state, | 
					
						
							|  |  |  | 		emailSender, | 
					
						
							| 
									
										
										
										
											2025-01-23 16:47:30 -08:00
										 |  |  | 		webPushSender, | 
					
						
							| 
									
										
										
										
											2024-07-24 13:27:42 +02:00
										 |  |  | 		visibility.NewFilter(state), | 
					
						
							| 
									
										
										
										
											2025-05-31 17:30:57 +02:00
										 |  |  | 		mutes.NewFilter(state), | 
					
						
							| 
									
										
										
										
											2024-07-24 13:27:42 +02:00
										 |  |  | 		interaction.NewFilter(state), | 
					
						
							|  |  |  | 	) | 
					
						
							| 
									
										
										
										
											2021-03-13 17:07:05 +01:00
										 |  |  | } |