Versions in this module Expand all Collapse all v0 v0.6.2 Dec 11, 2021 v0.6.1 Dec 11, 2021 Changes in this version + var DefaultDoubleCacheContentResolverCapacity = 16 * 1024 * 1024 + type CallbackContentResolver struct + InsertContentCallback func([]byte, []byte) + QueryContentCallback func([]byte) ([]byte, bool) + func (r CallbackContentResolver) InsertContent(id, content []byte) + func (r CallbackContentResolver) QueryContent(id []byte) ([]byte, bool) + type ContentResolver interface + InsertContent func(contentID, content []byte) + QueryContent func(contentID []byte) (content []byte, contentOk bool) + type DoubleCacheContentResolver struct + func NewDoubleCacheContentResolver(opts DoubleCacheContentResolverOptions, next ContentResolver) *DoubleCacheContentResolver + func (r *DoubleCacheContentResolver) InsertContent(id, content []byte) + func (r *DoubleCacheContentResolver) QueryContent(id []byte) ([]byte, bool) + type DoubleCacheContentResolverOptions struct + Capacity int + func DefaultDoubleCacheContentResolverOptions() DoubleCacheContentResolverOptions + func (opts DoubleCacheContentResolverOptions) WithCapacity(capacity int) DoubleCacheContentResolverOptions + type Expiry struct + type InMemTable struct + func NewInMemTable(self id.Signatory) *InMemTable + func (table *InMemTable) AddExpiry(peerID id.Signatory, duration time.Duration) + func (table *InMemTable) AddPeer(peerID id.Signatory, peerAddr wire.Address) + func (table *InMemTable) AddSubnet(signatories []id.Signatory) id.Hash + func (table *InMemTable) DeleteExpiry(peerID id.Signatory) + func (table *InMemTable) DeletePeer(peerID id.Signatory) + func (table *InMemTable) DeleteSubnet(hash id.Hash) + func (table *InMemTable) HandleExpired(peerID id.Signatory) bool + func (table *InMemTable) NumPeers() int + func (table *InMemTable) PeerAddress(peerID id.Signatory) (wire.Address, bool) + func (table *InMemTable) Peers(n int) []id.Signatory + func (table *InMemTable) RandomPeers(n int) []id.Signatory + func (table *InMemTable) Self() id.Signatory + func (table *InMemTable) Subnet(hash id.Hash) []id.Signatory + type Table interface + AddExpiry func(id.Signatory, time.Duration) + AddPeer func(id.Signatory, wire.Address) + AddSubnet func([]id.Signatory) id.Hash + DeleteExpiry func(id.Signatory) + DeletePeer func(id.Signatory) + DeleteSubnet func(id.Hash) + HandleExpired func(id.Signatory) bool + NumPeers func() int + PeerAddress func(id.Signatory) (wire.Address, bool) + Peers func(int) []id.Signatory + RandomPeers func(int) []id.Signatory + Self func() id.Signatory + Subnet func(id.Hash) []id.Signatory