consumer

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2025 License: AGPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddSearchResult

func AddSearchResult(factory *domain.Factory, args mapof.Any) queue.Result

AddSearchResult is a queue consumer that adds a new SearchResult to the database, and sends an ActivityPub message to all followers who are listening for the same set of tags.

func CreateWebSubFollower

func CreateWebSubFollower(factory *domain.Factory, args mapof.Any) queue.Result

func IndexAllStreams

func IndexAllStreams(factory *domain.Factory, args mapof.Any) queue.Result

func IndexAllUsers

func IndexAllUsers(factory *domain.Factory, args mapof.Any) queue.Result

func MakeStreamArchive

func MakeStreamArchive(factory *domain.Factory, _ *service.Stream, stream *model.Stream, args mapof.Any) queue.Result

func ProcessMedia

func ProcessMedia(factory *domain.Factory, args mapof.Any) queue.Result

func ReceiveWebMention

func ReceiveWebMention(factory *domain.Factory, args mapof.Any) queue.Result

func SendActivityPubMessage

func SendActivityPubMessage(factory *domain.Factory, args mapof.Any) queue.Result

SendActivityPubMessage sends an ActivityPub message to a single recipient/inboxURL `inboxURL` the URL to deliver the message to `actorType` the type of actor that is sending the message (User, Stream, Search) `actorID` unique ID of the actor (zero value for Search Actor) `message` the ActivityPub message to send

func SendWebMention

func SendWebMention(args mapof.Any) queue.Result

func SendWebSubMessage

func SendWebSubMessage(args mapof.Any) queue.Result

func StreamSyndicate

func StreamSyndicate(name string, args mapof.Any) queue.Result

StreamSyndicate sends HTTP messages to syndication targets

func WithFactory

func WithFactory(serverFactory ServerFactory, args mapof.Any, Handler func(factory *domain.Factory, args mapof.Any) queue.Result) queue.Result

WithFactory wraps a consumer function, and uses the "host" argument to inject a Factory object into the function signature.

func WithStream

func WithStream(serverFactory ServerFactory, args mapof.Any, Handler func(*domain.Factory, *service.Stream, *model.Stream, mapof.Any) queue.Result) queue.Result

WithStream wraps a consumer function, using the "streamId" argument to load a Stream object from the database.

Types

type Consumer

type Consumer struct {
	// contains filtered or unexported fields
}

Consumer is the primary queue consumer for Emissary. It handles background tasks that are triggered by the queue.

func New

func New(serverFactory ServerFactory) Consumer

New returns a fully initialized Consumer object

func (Consumer) Run

func (consumer Consumer) Run(name string, args map[string]any) queue.Result

Run is the actual consumer function that is called by the queue. It receives a task name and a map of arguments, and returns a boolean success value and an error.

type ServerFactory

type ServerFactory interface {
	ByDomainName(domain string) (*domain.Factory, error)
}

Jump to

Keyboard shortcuts

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