sentRoundTracker

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: 4 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 keeps track of rounds that file parts were sent on and when those rounds occurred. Rounds past the given age can be deleted manually. Adheres to excludedRounds.ExcludedRounds.

func NewManager

func NewManager(interval time.Duration) *Manager

NewManager creates a new sent round tracker Manager.

func (*Manager) Has

func (srt *Manager) Has(rid id.Round) bool

Has indicates if the round ID is in the tracker.

func (*Manager) Insert

func (srt *Manager) Insert(rid id.Round) bool

Insert adds the round to the tracker with the current time. Returns true if the round was added.

func (*Manager) Len

func (srt *Manager) Len() int

Len returns the number of round IDs in the tracker.

func (*Manager) Remove

func (srt *Manager) Remove(rid id.Round)

Remove deletes a round ID from the tracker.

func (*Manager) RemoveOldRounds

func (srt *Manager) RemoveOldRounds()

RemoveOldRounds removes any rounds that are older than the max round age.

Jump to

Keyboard shortcuts

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