2
0
mirror of synced 2025-02-24 14:48:27 +00:00
torrent/tracker/server/upstream-announcing.go

19 lines
447 B
Go
Raw Normal View History

2022-12-18 10:56:25 +11:00
package trackerServer
2022-12-13 16:41:08 +11:00
import (
"context"
"time"
)
type UpstreamAnnounceGater interface {
Start(ctx context.Context, tracker string, infoHash InfoHash,
2022-12-18 10:56:25 +11:00
// How long the announce block remains before discarding it.
2022-12-13 16:41:08 +11:00
timeout time.Duration,
) (bool, error)
Completed(
ctx context.Context, tracker string, infoHash InfoHash,
2022-12-18 10:56:25 +11:00
// Num of seconds reported by tracker, or some suitable value the caller has chosen.
2022-12-13 16:41:08 +11:00
interval int32,
) error
}