notifications

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2026 License: MIT Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package notifications connects Haul to the shared Beacon notifications (pulse/pkg/notify): finished and stalled downloads, and health.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HealthCheck

func HealthCheck(report func() *torrent.HealthReport) func(context.Context) []notify.Problem

HealthCheck turns Haul's health report into problems for notify.HealthWatcher.

func Setup

func Setup(ctx context.Context, d Deps) (*notify.Store, *notify.Outbox, error)

Setup opens the store, brings over config-file webhooks (once) and starts turning Haul's events into notifications. Run the returned outbox's Run in the background.

Types

type Deps

type Deps struct {
	DB       *sql.DB
	Torrents Torrents
	Bus      *events.Bus
	// Hub returns Pulse when Haul is connected to it, nil otherwise.
	Hub func() notify.Hub
	Log *slog.Logger
	// Webhooks from config.yaml (the old way to get events out of Haul);
	// brought over once as "Other app (URL)" channels.
	Webhooks []config.WebhookConfig
}

Deps is what Setup needs from Haul.

type Torrents

type Torrents interface {
	Get(hash string) (*torrent.Info, error)
}

Torrents is what the translator needs from Haul's session.

Jump to

Keyboard shortcuts

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