diff --git a/backend/backend.go b/backend/backend.go index a643741..7ec60ea 100644 --- a/backend/backend.go +++ b/backend/backend.go @@ -53,6 +53,10 @@ type Conn interface { // down the driver Close() error + // Ping just checks to see if the database is still alive. This is typically + // used for health checks. + Ping() error + // RecordAnnounce is called once per announce, and is passed the delta in // statistics for the client peer since its last announce. RecordAnnounce(delta *models.AnnounceDelta) error diff --git a/backend/noop/driver.go b/backend/noop/driver.go index 8fc6fd1..ab6a57c 100644 --- a/backend/noop/driver.go +++ b/backend/noop/driver.go @@ -14,6 +14,8 @@ import ( type driver struct{} +// NoOp is a backend driver for Chihaya that does nothing. This is used by +// public trackers. type NoOp struct{} // New returns a new Chihaya backend driver that does nothing. @@ -26,6 +28,11 @@ func (n *NoOp) Close() error { return nil } +// Ping returns nil. +func (n *NoOp) Ping() error { + return nil +} + // RecordAnnounce returns nil. func (n *NoOp) RecordAnnounce(delta *models.AnnounceDelta) error { return nil