# Functions
GlobalStats returns special stats used for global accounting.
LimitTPS limits the number of transactions per second if enabled.
NewRcloneCollector make a new RcloneCollector.
NewStats creates an initialised StatsInfo.
NewStatsGroup creates new stats under named group.
Start sets up the accounting, in particular the bandwidth limiting.
StartLimitTPS starts the token bucket for transactions per second limiting if necessary.
Stats gets stats by extracting group from context.
StatsGroup gets stats by group name.
StatsGroupFromContext returns group from the context if it's available.
UnWrap unwraps a reader returning unwrapped and wrap, a function to wrap it back up again.
WithStatsGroup returns copy of the parent context with assigned group.
# Constants
Slots for the token bucket.
Slots for the token bucket.
Slots for the token bucket.
Slots for the token bucket.
# Variables
ErrorMaxTransferLimitReached defines error when transfer limit is reached.
ErrorMaxTransferLimitReachedFatal is returned from Read when the max transfer limit is reached.
ErrorMaxTransferLimitReachedGraceful is returned from operations.Copy when the max transfer limit is reached and a graceful stop is required.
MaxCompletedTransfers specifies maximum number of completed transfers in startedTransfers list.
TokenBucket holds the global token bucket limiter.
# Structs
Account limits and accounts for one transfer.
RcloneCollector is a Prometheus collector for Rclone.
StatsInfo accounts all transfers N.B.: if this struct is modified, please remember to also update sum() function in stats_groups to correctly count the updated fields.
Transfer keeps track of initiated transfers and provides access to accounting functions.
TransferSnapshot represents state of an account at point in time.
# Interfaces
Accounter accounts a stream allowing the accounting to be removed and re-added.
# Type aliases
TokenBucketSlot is the type to select which token bucket to use.
WrapFn wraps an io.Reader (for accounting purposes usually).