Documentation ¶
Index ¶
- Variables
- type Addresses
- type CryptoPublicKeySyncList
- type LocalPeer
- func (p *LocalPeer) AddAddress(protocol string, addrs []string)
- func (p *LocalPeer) AddContentHash(hashes ...object.Hash)
- func (p *LocalPeer) AddContentTypes(types ...string)
- func (p *LocalPeer) AddIdentityKey(identityPrivateKey crypto.PrivateKey) error
- func (p *LocalPeer) AddRelays(relayPeer crypto.PublicKey)
- func (p *LocalPeer) GetAddresses() []string
- func (p *LocalPeer) GetCertificates() []*object.Certificate
- func (p *LocalPeer) GetContentHashes() []object.Hash
- func (p *LocalPeer) GetContentTypes() []string
- func (p *LocalPeer) GetHostname() string
- func (p *LocalPeer) GetIdentityPrivateKey() crypto.PrivateKey
- func (p *LocalPeer) GetIdentityPublicKey() crypto.PublicKey
- func (p *LocalPeer) GetPeerPrivateKey() crypto.PrivateKey
- func (p *LocalPeer) GetPeerPublicKey() crypto.PublicKey
- func (p *LocalPeer) GetSignedPeer() *Peer
- func (p *LocalPeer) OnAddressesUpdated(h OnAddressesUpdated)
- func (p *LocalPeer) OnContentHashesUpdated(h OnContentHashesUpdated)
- func (p *LocalPeer) RemoveContentHash(hashes ...object.Hash)
- type LookupFilter
- type LookupOption
- type LookupOptions
- type LookupRequest
- type LookupResponse
- type ObjectHashSyncList
- type OnAddressesUpdated
- type OnContentHashesUpdated
- type Peer
- type StringAddressesSyncMap
Constants ¶
This section is empty.
Variables ¶
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 CryptoPublicKeySyncList ¶ added in v0.5.0
type CryptoPublicKeySyncList struct {
// contains filtered or unexported fields
}
CryptoPublicKeySyncList -
func NewCryptoPublicKeyValueTypeSyncMap ¶ added in v0.5.0
func NewCryptoPublicKeyValueTypeSyncMap() *CryptoPublicKeySyncList
NewCryptoPublicKeyValueTypeSyncMap constructs a new SyncMap
func (*CryptoPublicKeySyncList) Delete ¶ added in v0.5.0
func (m *CryptoPublicKeySyncList) Delete(k crypto.PublicKey)
Delete -
func (*CryptoPublicKeySyncList) Exists ¶ added in v0.5.0
func (m *CryptoPublicKeySyncList) Exists(k crypto.PublicKey) bool
Exists -
func (*CryptoPublicKeySyncList) Put ¶ added in v0.5.0
func (m *CryptoPublicKeySyncList) Put(k crypto.PublicKey)
Put -
type LocalPeer ¶
type LocalPeer struct {
// contains filtered or unexported fields
}
func NewLocalPeer ¶
func NewLocalPeer( hostname string, peerPrivateKey crypto.PrivateKey, ) (*LocalPeer, error)
func (*LocalPeer) AddAddress ¶
func (*LocalPeer) AddContentHash ¶
AddContentHash that should be published with the peer info
func (*LocalPeer) AddContentTypes ¶ added in v0.5.0
func (*LocalPeer) AddIdentityKey ¶
func (p *LocalPeer) AddIdentityKey(identityPrivateKey crypto.PrivateKey) error
func (*LocalPeer) GetAddresses ¶
func (*LocalPeer) GetCertificates ¶ added in v0.5.0
func (p *LocalPeer) GetCertificates() []*object.Certificate
GetCertificate returns the peer's certificate
func (*LocalPeer) GetContentHashes ¶
func (*LocalPeer) GetContentTypes ¶ added in v0.5.0
func (*LocalPeer) GetHostname ¶
func (*LocalPeer) GetIdentityPrivateKey ¶ added in v0.5.0
func (p *LocalPeer) GetIdentityPrivateKey() crypto.PrivateKey
func (*LocalPeer) GetIdentityPublicKey ¶ added in v0.5.0
func (*LocalPeer) GetPeerPrivateKey ¶ added in v0.5.0
func (p *LocalPeer) GetPeerPrivateKey() crypto.PrivateKey
func (*LocalPeer) GetPeerPublicKey ¶ added in v0.5.0
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 LookupOption ¶ added in v0.5.0
type LookupOption func(*LookupOptions)
LookupOptions
func LookupByCertificateSigner ¶ added in v0.5.0
func LookupByCertificateSigner(certSigner crypto.PublicKey) LookupOption
LookupByCertificateSigner matches certificate signers
func LookupByContentHash ¶ added in v0.5.0
func LookupByContentHash(hash object.Hash) LookupOption
LookupByContentHash matches content hashes
func LookupByContentType ¶ added in v0.5.0
func LookupByContentType(contentType string) LookupOption
LookupByContentType matches content hashes
func LookupByOwner ¶ added in v0.5.0
func LookupByOwner(keys ...crypto.PublicKey) LookupOption
LookupByOwner matches the peer key
func LookupOnlyLocal ¶ added in v0.5.0
func LookupOnlyLocal() LookupOption
LookupOnlyLocal forces the discoverer to only look at its cache
type LookupOptions ¶ added in v0.5.0
type LookupOptions struct { Local bool // Lookups are strings we are looking for, will be used to create a // bloom filter when forwarding the lookup request to providers Lookups []string // filters are the lookups equivalents for matching local peers Filters []LookupFilter }
LookupOptions
func ParseLookupOptions ¶ added in v0.5.0
func ParseLookupOptions(opts ...LookupOption) *LookupOptions
func (LookupOptions) Match ¶ added in v0.5.0
func (l LookupOptions) Match(p *Peer) bool
type LookupRequest ¶ added in v0.5.0
type LookupRequest struct { Stream object.Hash Parents []object.Hash Owners []crypto.PublicKey Policy object.Policy Signatures []object.Signature Nonce string Bloom []int64 // contains filtered or unexported fields }
func (*LookupRequest) FromObject ¶ added in v0.5.0
func (e *LookupRequest) FromObject(o object.Object) error
func (LookupRequest) GetSchema ¶ added in v0.5.0
func (e LookupRequest) GetSchema() *object.SchemaObject
func (LookupRequest) GetType ¶ added in v0.5.0
func (e LookupRequest) GetType() string
func (LookupRequest) ToObject ¶ added in v0.5.0
func (e LookupRequest) ToObject() object.Object
type LookupResponse ¶ added in v0.5.0
type LookupResponse struct { Stream object.Hash Parents []object.Hash Owners []crypto.PublicKey Policy object.Policy Signatures []object.Signature Nonce string Bloom []int64 Peers []*Peer // contains filtered or unexported fields }
func (*LookupResponse) FromObject ¶ added in v0.5.0
func (e *LookupResponse) FromObject(o object.Object) error
func (LookupResponse) GetSchema ¶ added in v0.5.0
func (e LookupResponse) GetSchema() *object.SchemaObject
func (LookupResponse) GetType ¶ added in v0.5.0
func (e LookupResponse) GetType() string
func (LookupResponse) ToObject ¶ added in v0.5.0
func (e LookupResponse) ToObject() object.Object
type ObjectHashSyncList ¶ added in v0.5.0
type ObjectHashSyncList struct {
// contains filtered or unexported fields
}
ObjectHashSyncList -
func NewObjectHashValueTypeSyncMap ¶ added in v0.5.0
func NewObjectHashValueTypeSyncMap() *ObjectHashSyncList
NewObjectHashValueTypeSyncMap constructs a new SyncMap
func (*ObjectHashSyncList) Delete ¶ added in v0.5.0
func (m *ObjectHashSyncList) Delete(k object.Hash)
Delete -
func (*ObjectHashSyncList) Exists ¶ added in v0.5.0
func (m *ObjectHashSyncList) Exists(k object.Hash) bool
Exists -
func (*ObjectHashSyncList) Put ¶ added in v0.5.0
func (m *ObjectHashSyncList) Put(k object.Hash)
Put -
type OnAddressesUpdated ¶
type OnAddressesUpdated func([]string)
type OnContentHashesUpdated ¶
type Peer ¶
type Peer struct { Stream object.Hash Parents []object.Hash Owners []crypto.PublicKey Policy object.Policy Signatures []object.Signature Version int64 Addresses []string Bloom []int64 ContentTypes []string Certificates []*object.Certificate Relays []crypto.PublicKey // contains filtered or unexported fields }
func (Peer) GetSchema ¶ added in v0.5.0
func (e Peer) GetSchema() *object.SchemaObject
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 -