blob: 2810fd4e5a037fe17a25196b5258d130fec97c96 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
package models
import (
"fmt"
"net"
"time"
)
// Peer on DHT network
type Peer struct {
Addr net.Addr `db:"address"`
Infohash Infohash `db:"infohash"`
Created time.Time `db:"created" json:"created"`
Updated time.Time `db:"updated" json:"updated"`
}
// String implements fmt.Stringer
func (p Peer) String() string {
return fmt.Sprintf("%s (%s)", p.Infohash, p.Addr.String())
}
|