27 lines
574 B
Go
27 lines
574 B
Go
|
package peering
|
||
|
|
||
|
import (
|
||
|
"errors"
|
||
|
"time"
|
||
|
)
|
||
|
|
||
|
var (
|
||
|
ErrPeerNotFound = errors.New("peer not found")
|
||
|
ErrPeerExists = errors.New("peer exists")
|
||
|
)
|
||
|
|
||
|
type Store interface {
|
||
|
Create(id PeerID, attrs PeerAttributes) (*Peer, error)
|
||
|
Get(id PeerID) (*Peer, error)
|
||
|
Delete(id PeerID) error
|
||
|
List() ([]PeerHeader, error)
|
||
|
|
||
|
UpdatePublicKey(id PeerID, publicKey []byte) error
|
||
|
UpdateAttributes(id PeerID, attrs PeerAttributes) error
|
||
|
UpdateLastContact(id PeerID, remoteAddress string, ts time.Time) error
|
||
|
|
||
|
Accept(id PeerID) error
|
||
|
Forget(id PeerID) error
|
||
|
Reject(id PeerID) error
|
||
|
}
|