Documentation ¶
Index ¶
- Constants
- Variables
- func ACLQueryFilter(acl ACL, protocol protocol.ID, logger commontypes.Logger) dht.QueryFilterFunc
- func ACLRoutingTableFilter(acl ACL, protocol protocol.ID, logger commontypes.Logger) dht.RouteTableFilterFunc
- type ACL
- type ACLHost
- type AnnouncementValidator
- type BasicACLHost
- func (aclHost BasicACLHost) Addrs() []ma.Multiaddr
- func (aclHost BasicACLHost) Close() error
- func (aclHost BasicACLHost) ConnManager() connmgr.ConnManager
- func (aclHost BasicACLHost) Connect(ctx context.Context, pi peer.AddrInfo) error
- func (aclHost BasicACLHost) EventBus() event.Bus
- func (aclHost BasicACLHost) GetACL() ACL
- func (aclHost BasicACLHost) ID() peer.ID
- func (aclHost BasicACLHost) Mux() protocol.Switch
- func (aclHost BasicACLHost) Network() p2pnetwork.Network
- func (aclHost BasicACLHost) NewStream(ctx context.Context, p peer.ID, pids ...protocol.ID) (p2pnetwork.Stream, error)
- func (aclHost BasicACLHost) Peerstore() peerstore.Peerstore
- func (aclHost BasicACLHost) RemoveStreamHandler(pid protocol.ID)
- func (aclHost *BasicACLHost) SetACL(acl ACL)
- func (aclHost BasicACLHost) SetStreamHandler(protocol protocol.ID, handler p2pnetwork.StreamHandler)
- func (aclHost BasicACLHost) SetStreamHandlerMatch(id protocol.ID, f func(string) bool, handler p2pnetwork.StreamHandler)
- type DHTNodeConfig
- type DHTRouter
- type PeerDiscoveryRouter
- type PermitListACL
Constants ¶
View Source
const ValidatorNamespace = "peerinfo"
Variables ¶
View Source
var InvalidDhtKey = errors.New("invalid dht key")
Functions ¶
func ACLQueryFilter ¶
func ACLQueryFilter(acl ACL, protocol protocol.ID, logger commontypes.Logger) dht.QueryFilterFunc
ACLQueryFilter is a filter applied when considering peers to dial when querying
func ACLRoutingTableFilter ¶
func ACLRoutingTableFilter(acl ACL, protocol protocol.ID, logger commontypes.Logger) dht.RouteTableFilterFunc
ACLRoutingTableFilter is a filter applied when considering connections to keep in the local route table.
Types ¶
type AnnouncementValidator ¶
type AnnouncementValidator struct{}
AnnouncementValidator verifies peer announcements
type BasicACLHost ¶
type BasicACLHost struct {
// contains filtered or unexported fields
}
func (BasicACLHost) Addrs ¶
func (aclHost BasicACLHost) Addrs() []ma.Multiaddr
func (BasicACLHost) Close ¶
func (aclHost BasicACLHost) Close() error
func (BasicACLHost) ConnManager ¶
func (aclHost BasicACLHost) ConnManager() connmgr.ConnManager
func (BasicACLHost) EventBus ¶
func (aclHost BasicACLHost) EventBus() event.Bus
func (BasicACLHost) GetACL ¶
func (aclHost BasicACLHost) GetACL() ACL
func (BasicACLHost) ID ¶
func (aclHost BasicACLHost) ID() peer.ID
func (BasicACLHost) Mux ¶
func (aclHost BasicACLHost) Mux() protocol.Switch
func (BasicACLHost) Network ¶
func (aclHost BasicACLHost) Network() p2pnetwork.Network
func (BasicACLHost) NewStream ¶
func (aclHost BasicACLHost) NewStream(ctx context.Context, p peer.ID, pids ...protocol.ID) (p2pnetwork.Stream, error)
func (BasicACLHost) Peerstore ¶
func (aclHost BasicACLHost) Peerstore() peerstore.Peerstore
func (BasicACLHost) RemoveStreamHandler ¶
func (aclHost BasicACLHost) RemoveStreamHandler(pid protocol.ID)
func (*BasicACLHost) SetACL ¶
func (aclHost *BasicACLHost) SetACL(acl ACL)
func (BasicACLHost) SetStreamHandler ¶
func (aclHost BasicACLHost) SetStreamHandler(protocol protocol.ID, handler p2pnetwork.StreamHandler)
func (BasicACLHost) SetStreamHandlerMatch ¶
func (aclHost BasicACLHost) SetStreamHandlerMatch(id protocol.ID, f func(string) bool, handler p2pnetwork.StreamHandler)
type DHTNodeConfig ¶
type DHTNodeConfig struct {
// contains filtered or unexported fields
}
func BuildConfig ¶
func BuildConfig( bootstrapNodes []peer.AddrInfo, prefix protocol.ID, configDigest ocr1types.ConfigDigest, logger loghelper.LoggerWithContext, bootstrapConnectionCheckInterval time.Duration, failureThreshold int, extendedDHTLogging bool, announcementUserPrefix uint32, ) DHTNodeConfig
func (*DHTNodeConfig) AddBootstrapNodes ¶
func (config *DHTNodeConfig) AddBootstrapNodes(addrs []peer.AddrInfo)
func (DHTNodeConfig) ProtocolID ¶
func (config DHTNodeConfig) ProtocolID() protocol.ID
func (DHTNodeConfig) String ¶
func (config DHTNodeConfig) String() string
type DHTRouter ¶
type DHTRouter struct {
// contains filtered or unexported fields
}
func (DHTRouter) ProtocolID ¶
func (router DHTRouter) ProtocolID() p2pprotocol.ID
type PeerDiscoveryRouter ¶
type PeerDiscoveryRouter interface { rhost.Routing Start() Close() error ProtocolID() p2pprotocol.ID }
PeerDiscoveryRouter is a router (rhost.Routing) with resource management capabilities via Start() and Close()
func NewDHTRouter ¶
func NewDHTRouter(ctx context.Context, config DHTNodeConfig, aclHost ACLHost) (PeerDiscoveryRouter, error)
type PermitListACL ¶
type PermitListACL interface { ACL // Activate ACL for a protocol with the provided allowlist. // No-op if ACL is already activated for that protocol Activate(protocol protocol.ID, permitted ...peer.ID) // Deactivate ACL for a protocol. No-op if not already activated Deactivate(protocol protocol.ID) // add ids to the allowlist for protocol. Error if not already activated Permit(protocol protocol.ID, ids ...peer.ID) error // remove id from the allowlist. Error if not already activated. Reject(protocol protocol.ID, id peer.ID) error }
func NewPermitListACL ¶
func NewPermitListACL(logger loghelper.LoggerWithContext) PermitListACL
Source Files ¶
Click to show internal directories.
Click to hide internal directories.