Documentation ¶
Index ¶
- Variables
- type Addresses
- type LocalPeer
- func (p *LocalPeer) AddAddress(protocol string, addrs []string)
- func (p *LocalPeer) AddContentHash(hashes ...string)
- func (p *LocalPeer) AddIdentityKey(identityKey *crypto.PrivateKey) error
- func (p *LocalPeer) GetAddress() string
- func (p *LocalPeer) GetAddresses() []string
- func (p *LocalPeer) GetContentHashes() []string
- func (p *LocalPeer) GetFingerprint() crypto.Fingerprint
- func (p *LocalPeer) GetHostname() string
- func (p *LocalPeer) GetPeerKey() *crypto.PrivateKey
- func (p *LocalPeer) GetSignedPeer() *Peer
- func (p *LocalPeer) OnAddressesUpdated(h OnAddressesUpdated)
- func (p *LocalPeer) OnContentHashesUpdated(h OnContentHashesUpdated)
- func (p *LocalPeer) RemoveContentHash(hashes ...string)
- type OnAddressesUpdated
- type OnContentHashesUpdated
- type Peer
- type Requested
- type StringAddressesSyncMap
- type StringSyncList
- type Updated
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrMissingKey when a key is not passed ErrMissingKey = errors.New("missing key") // ErrECDSAPrivateKeyRequired when a key is not an ECDSA key ErrECDSAPrivateKeyRequired = errors.New( "network currently requires an ecdsa private key") )
Functions ¶
This section is empty.
Types ¶
type LocalPeer ¶
type LocalPeer struct {
// contains filtered or unexported fields
}
func NewLocalPeer ¶
func NewLocalPeer( hostname string, key *crypto.PrivateKey, ) (*LocalPeer, error)
func (*LocalPeer) AddAddress ¶
func (*LocalPeer) AddContentHash ¶
AddContentHash that should be published with the peer info
func (*LocalPeer) AddIdentityKey ¶
func (p *LocalPeer) AddIdentityKey(identityKey *crypto.PrivateKey) error
func (*LocalPeer) GetAddress ¶
func (*LocalPeer) GetAddresses ¶
func (*LocalPeer) GetContentHashes ¶
func (*LocalPeer) GetFingerprint ¶
func (p *LocalPeer) GetFingerprint() crypto.Fingerprint
func (*LocalPeer) GetHostname ¶
func (*LocalPeer) GetPeerKey ¶
func (p *LocalPeer) GetPeerKey() *crypto.PrivateKey
func (*LocalPeer) GetSignedPeer ¶
GetSignedPeer returns the local peer info
func (*LocalPeer) OnAddressesUpdated ¶
func (p *LocalPeer) OnAddressesUpdated(h OnAddressesUpdated)
func (*LocalPeer) OnContentHashesUpdated ¶
func (p *LocalPeer) OnContentHashesUpdated(h OnContentHashesUpdated)
func (*LocalPeer) RemoveContentHash ¶
RemoveContentHash from the peer info
type OnAddressesUpdated ¶
type OnAddressesUpdated func([]string)
type OnContentHashesUpdated ¶
type OnContentHashesUpdated func([]string)
type Peer ¶
type Peer struct { Addresses []string `json:"addresses:as"` Signature *crypto.Signature `json:"@signature:o"` }
func (*Peer) ContextName ¶
type Requested ¶
type StringAddressesSyncMap ¶
type StringAddressesSyncMap struct {
// contains filtered or unexported fields
}
StringAddressesSyncMap -
func NewStringAddressesSyncMap ¶
func NewStringAddressesSyncMap() *StringAddressesSyncMap
NewStringAddressesSyncMap constructs a new SyncMap
func (*StringAddressesSyncMap) Get ¶
func (m *StringAddressesSyncMap) Get(k string) (*Addresses, bool)
Get -
func (*StringAddressesSyncMap) Put ¶
func (m *StringAddressesSyncMap) Put(k string, v *Addresses)
Put -
type StringSyncList ¶
type StringSyncList struct {
// contains filtered or unexported fields
}
StringSyncList -
func NewStringValueTypeSyncMap ¶
func NewStringValueTypeSyncMap() *StringSyncList
NewStringValueTypeSyncMap constructs a new SyncMap
Click to show internal directories.
Click to hide internal directories.