Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LinkProcessor ¶
type LinkProcessor struct { // InstagramFetcher fetches content from Instagram. InstagramFetcher domain.InstagramFetcher // ThreadsFetcher fetches content from Threads. ThreadsFetcher domain.ThreadsFetcher // MediaSender sends the processed media to the destination (e.g., Telegram). MediaSender domain.MediaSender }
LinkProcessor orchestrates the fetching and sending of media based on the input link.
func NewLinkProcessor ¶
func NewLinkProcessor(req NewLinkProcessorRequest) *LinkProcessor
NewLinkProcessor creates a new instance of LinkProcessor with the provided dependencies.
func (*LinkProcessor) ProcessLink ¶
func (processor *LinkProcessor) ProcessLink(link string) error
ProcessLink takes a URL string, determines the source (Instagram or Threads), fetches the media content using the appropriate fetcher, and then sends it using the configured MediaSender.
type NewLinkProcessorRequest ¶
type NewLinkProcessorRequest struct { // InstagramFetcher fetches content from Instagram. InstagramFetcher domain.InstagramFetcher // ThreadsFetcher fetches content from Threads. ThreadsFetcher domain.ThreadsFetcher // Sender sends the processed media. Sender domain.MediaSender }
NewLinkProcessorRequest contains the dependencies required to create a LinkProcessor.
Click to show internal directories.
Click to hide internal directories.