You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

store.go 574B

1234567891011121314151617181920212223242526
  1. package peering
  2. import (
  3. "errors"
  4. "time"
  5. )
  6. var (
  7. ErrPeerNotFound = errors.New("peer not found")
  8. ErrPeerExists = errors.New("peer exists")
  9. )
  10. type Store interface {
  11. Create(id PeerID, attrs PeerAttributes) (*Peer, error)
  12. Get(id PeerID) (*Peer, error)
  13. Delete(id PeerID) error
  14. List() ([]PeerHeader, error)
  15. UpdatePublicKey(id PeerID, publicKey []byte) error
  16. UpdateAttributes(id PeerID, attrs PeerAttributes) error
  17. UpdateLastContact(id PeerID, remoteAddress string, ts time.Time) error
  18. Accept(id PeerID) error
  19. Forget(id PeerID) error
  20. Reject(id PeerID) error
  21. }