Documentation ¶
Index ¶
Constants ¶
View Source
const (
PeerInfoRequestType = "/peer.request"
)
View Source
const (
PeerInfoType = "/peer"
)
Variables ¶
View Source
var ( // ErrNotFound is returned wheh a requqested item in the collection does // not exist ErrNotFound = errors.New("peer not found") )
Functions ¶
This section is empty.
Types ¶
type PeerInfo ¶
type PeerInfo struct { Addresses []string `json:"addresses"` Protocols []string `json:"protocols"` ContentIDs []string `json:"contentIDs"` ContentTypes []string `json:"contentTypes"` Signature *crypto.Signature `json:"@signature"` }
PeerInfo holds the information exchange needs to connect to a remote peer
func (*PeerInfo) Fingerprint ¶
func (pi *PeerInfo) Fingerprint() crypto.Fingerprint
Fingerprint of signer
func (*PeerInfo) FromObject ¶
FromObject populates the struct from a f12n object
type PeerInfoCollection ¶
type PeerInfoCollection struct {
// contains filtered or unexported fields
}
PeerInfoCollection allows concurrent access to peerinfos
func (*PeerInfoCollection) All ¶
func (c *PeerInfoCollection) All() ([]*PeerInfo, error)
All returns all items in the collection
func (*PeerInfoCollection) Get ¶
func (c *PeerInfoCollection) Get(fingerprint string) (*PeerInfo, error)
Get retuns a single item from the collection given its id
func (*PeerInfoCollection) Put ¶
func (c *PeerInfoCollection) Put(peerInfo *PeerInfo) error
Put adds or overwrites an item in the collection
type PeerInfoRequest ¶
type PeerInfoRequest struct { Keys []crypto.Fingerprint Protocols []string ContentIDs []string ContentTypes []string }
PeerInfoRequest is a request for a peer info
func (*PeerInfoRequest) FromObject ¶
func (s *PeerInfoRequest) FromObject(o *object.Object) error
FromObject populates the struct from a f12n object
func (PeerInfoRequest) GetType ¶
func (s PeerInfoRequest) GetType() string
GetType returns the object's type
func (PeerInfoRequest) ToObject ¶
func (s PeerInfoRequest) ToObject() *object.Object
ToObject returns a f12n object
Click to show internal directories.
Click to hide internal directories.