Skip to content

Commit

Permalink
Merge pull request #863 from arch3754/master
Browse files Browse the repository at this point in the history
add ListServices
  • Loading branch information
smallnest authored Jul 12, 2024
2 parents c0ed6ea + 65115cd commit 9d62234
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions server/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,16 @@ func isExportedOrBuiltinType(t reflect.Type) bool {
return isExported(t.Name()) || t.PkgPath() == ""
}

func (s *Server) ListServices() []string {
s.serviceMapMu.RLock()
defer s.serviceMapMu.RUnlock()
var arr []string
for name := range s.serviceMap {
arr = append(arr, name)
}
return arr
}

// Register publishes in the server the set of methods of the
// receiver value that satisfy the following conditions:
// - exported method of exported type
Expand Down

0 comments on commit 9d62234

Please sign in to comment.