Skip to content

Commit 9d62234

Browse files
authored
Merge pull request #863 from arch3754/master
add ListServices
2 parents c0ed6ea + 65115cd commit 9d62234

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

โ€Žserver/service.go

+10
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,16 @@ func isExportedOrBuiltinType(t reflect.Type) bool {
5959
return isExported(t.Name()) || t.PkgPath() == ""
6060
}
6161

62+
func (s *Server) ListServices() []string {
63+
s.serviceMapMu.RLock()
64+
defer s.serviceMapMu.RUnlock()
65+
var arr []string
66+
for name := range s.serviceMap {
67+
arr = append(arr, name)
68+
}
69+
return arr
70+
}
71+
6272
// Register publishes in the server the set of methods of the
6373
// receiver value that satisfy the following conditions:
6474
// - exported method of exported type

0 commit comments

Comments
ย (0)