providers

package
v0.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 28, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

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 (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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL