dispatcher

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package dispatcher contains the dispatcher service.

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("not found")

Functions

This section is empty.

Types

type Clock

type Clock interface {
	Now() time.Time
}

type Dispatcher

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

Dispatcher is a service that fetches items from feeds and forwards them to webhooks.

func New

func New(st *storage.Storage, cfg config.Config, clock Clock) *Dispatcher

New creates a new App instance and returns it.

func (*Dispatcher) Close

func (d *Dispatcher) Close()

Close conducts a graceful shutdown of the dispatcher.

func (*Dispatcher) MessengerStatus

func (d *Dispatcher) MessengerStatus(webhookName string) (messenger.Status, error)

MessengerStatus returns the current status of a messenger.

func (*Dispatcher) PostLatestFeedItem

func (d *Dispatcher) PostLatestFeedItem(feedName string) error

func (*Dispatcher) Start

func (d *Dispatcher) Start() error

Start starts the dispatcher User should call Close() subsequently to shut down dispatcher gracefully and prevent any potential data loss.

Jump to

Keyboard shortcuts

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