MCPcopy
hub / github.com/dragonflyoss/dragonfly / PeerManager

Interface PeerManager

scheduler/resource/standard/peer_manager.go:36–60  ·  view source on GitHub ↗

PeerManager is the interface used for peer manager.

Source from the content-addressed store, hash-verified

34
35// PeerManager is the interface used for peer manager.
36type PeerManager interface {
37 // Load returns peer for a key.
38 Load(string) (*Peer, bool)
39
40 // Store sets peer.
41 Store(*Peer)
42
43 // LoadOrStore returns peer the key if present.
44 // Otherwise, it stores and returns the given peer.
45 // The loaded result is true if the peer was loaded, false if stored.
46 LoadOrStore(*Peer) (*Peer, bool)
47
48 // Delete deletes peer for a key.
49 Delete(string)
50
51 // DeleteAllByHostID deletes all peers by host id.
52 DeleteAllByHostID(string)
53
54 // Range calls f sequentially for each key and value present in the map.
55 // If f returns false, range stops the iteration.
56 Range(f func(any, any) bool)
57
58 // Try to reclaim peer.
59 RunGC(context.Context) error
60}
61
62// peerManager contains content for peer manager.
63type peerManager struct {

Callers 19

AnnounceTaskMethod · 0.65
LoadOrStoreMethod · 0.65
AddVertexMethod · 0.65
AddVertexMethod · 0.65
TestServiceV2_ListHostsFunction · 0.65
StatPeerMethod · 0.65
StatTaskMethod · 0.65
DeleteTaskMethod · 0.65

Calls

no outgoing calls

Tested by

no test coverage detected