callbackTracker

package
v4.7.2 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2024 License: BSD-2-Clause, BSD-2-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

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

Manager tracks the callbacks for each transfer.

func NewManager

func NewManager() *Manager

NewManager initializes a new callback tracker Manager.

func (*Manager) AddCallback

func (m *Manager) AddCallback(
	fid ftCrypto.ID, cb callback, period time.Duration)

AddCallback adds a callback to the list of callbacks for the given transfer ID and calls it regardless of the callback tracker status.

func (*Manager) Call

func (m *Manager) Call(fid ftCrypto.ID, err error)

Call triggers each callback for the given file ID and passes along the given error.

func (*Manager) Delete

func (m *Manager) Delete(fid ftCrypto.ID)

Delete stops all scheduled stoppables for the given transfer and deletes the callbacks from the map.

Jump to

Keyboard shortcuts

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