Add Close to Conn interface
This commit is contained in:
parent
5bd3b3efb3
commit
b962f49c90
2 changed files with 6 additions and 0 deletions
|
@ -68,6 +68,8 @@ type Pool interface {
|
||||||
// Conn represents a connection to the data store that can be used
|
// Conn represents a connection to the data store that can be used
|
||||||
// to make reads/writes.
|
// to make reads/writes.
|
||||||
type Conn interface {
|
type Conn interface {
|
||||||
|
Close() error
|
||||||
|
|
||||||
// Torrent interactions
|
// Torrent interactions
|
||||||
FindTorrent(infohash string) (*models.Torrent, error)
|
FindTorrent(infohash string) (*models.Torrent, error)
|
||||||
PutTorrent(t *models.Torrent) error
|
PutTorrent(t *models.Torrent) error
|
||||||
|
|
|
@ -17,6 +17,10 @@ type Conn struct {
|
||||||
*Pool
|
*Pool
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *Conn) Close() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
func (c *Conn) FindUser(passkey string) (*models.User, error) {
|
func (c *Conn) FindUser(passkey string) (*models.User, error) {
|
||||||
c.usersM.RLock()
|
c.usersM.RLock()
|
||||||
defer c.usersM.RUnlock()
|
defer c.usersM.RUnlock()
|
||||||
|
|
Loading…
Add table
Reference in a new issue