announcer

package
v0.0.0-...-4be01c1 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2024 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Skip

func Skip(announcer ImportAnnouncer)

Skip an import, notifying it's finished as soon as it starts

Types

type DummyImportAnnouncer

type DummyImportAnnouncer struct {
	sync.Mutex
	Start time.Time
	// contains filtered or unexported fields
}

func (*DummyImportAnnouncer) AnnounceProgress

func (a *DummyImportAnnouncer) AnnounceProgress(p Progress)

func (*DummyImportAnnouncer) AnnounceStart

func (a *DummyImportAnnouncer) AnnounceStart(t time.Time)

func (*DummyImportAnnouncer) Progress

func (a *DummyImportAnnouncer) Progress() []Progress

type EmptyImportAnnouncer

type EmptyImportAnnouncer struct{}

does nothing

func (*EmptyImportAnnouncer) AnnounceProgress

func (*EmptyImportAnnouncer) AnnounceProgress(Progress)

func (*EmptyImportAnnouncer) AnnounceStart

func (*EmptyImportAnnouncer) AnnounceStart(time.Time)

type ImportAnnouncer

type ImportAnnouncer interface {
	AnnounceStart(time.Time)
	AnnounceProgress(Progress)
}

func Skipper

func Skipper(announcer ImportAnnouncer) ImportAnnouncer

Skipper allows progress announcers to be skipt

type MostRecentLogTimeProvider

type MostRecentLogTimeProvider func() (time.Time, error)

type Notifier

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

func NewNotifier

func NewNotifier(announcer ImportAnnouncer, steps int) Notifier

func (*Notifier) End

func (p *Notifier) End(t time.Time)

func (*Notifier) Start

func (p *Notifier) Start(t time.Time)

func (*Notifier) Step

func (p *Notifier) Step(t time.Time)

type Progress

type Progress struct {
	Finished bool
	Time     time.Time
	Progress int64
}

type SynchronizingAnnouncer

type SynchronizingAnnouncer struct {
	runner.CancellableRunner
	// contains filtered or unexported fields
}

func NewSynchronizingAnnouncer

func NewSynchronizingAnnouncer(announcer ImportAnnouncer, primary, secondary MostRecentLogTimeProvider) *SynchronizingAnnouncer

In Control Center, the primary is deliverydb.DB{} and secondary is tracking.Tracker{} the primary expected to never have times higher than the secondary, as the tracking is expected to always have log lines more recent (or at least equal) than the times of delivery attempts

func (*SynchronizingAnnouncer) AnnounceProgress

func (c *SynchronizingAnnouncer) AnnounceProgress(p Progress)

func (*SynchronizingAnnouncer) AnnounceStart

func (c *SynchronizingAnnouncer) AnnounceStart(t time.Time)

Jump to

Keyboard shortcuts

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