Skip to content
This repository was archived by the owner on Sep 6, 2022. It is now read-only.

Commit 25d4931

Browse files
committed
turn resource manager scope accessors into viewers
1 parent 76a25c9 commit 25d4931

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

network/rcmgr.go

+10-12
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,16 @@ var (
1414

1515
// ResourceManager is the interface to the network resource management subsystem
1616
type ResourceManager interface {
17-
// GetSystem retrieves the system wide resource scope
18-
GetSystem() ResourceScope
19-
// GetTransient retrieves the transient (DMZ) resource scope
20-
GetTransient() ResourceScope
21-
// GetService retrieves a service-specific scope
22-
GetService(srv string) ServiceScope
23-
// GetProtocol retrieves the resource management scope for a specific protocol.
24-
// If there is no configured limits for a particular protocol, then the default scope is
25-
// returned.
26-
GetProtocol(protocol.ID) ProtocolScope
27-
// GetPeer retrieces the resource management scope for a specific peer.
28-
GetPeer(peer.ID) PeerScope
17+
// Viewystem views the system wide resource scope
18+
ViewSystem(func(ResourceScope) error) error
19+
// ViewTransient views the transient (DMZ) resource scope
20+
ViewTransient(func(ResourceScope) error) error
21+
// ViewService retrieves a service-specific scope
22+
ViewService(string, func(ServiceScope) error) error
23+
// ViewProtocol views the resource management scope for a specific protocol.
24+
ViewProtocol(protocol.ID, func(ProtocolScope) error) error
25+
// ViewPeer views the resource management scope for a specific peer.
26+
ViewPeer(peer.ID, func(PeerScope) error) error
2927

3028
// OpenConnection creates a connection scope not yet associated with any peer; the connection
3129
// is scoped at the transient scope.

0 commit comments

Comments
 (0)