backend: add a Ping method to backend
This commit is contained in:
parent
e02f1dd0ea
commit
a0bcc07893
2 changed files with 11 additions and 0 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue