summaryrefslogtreecommitdiff
path: root/service/container.go
diff options
context:
space:
mode:
authorWolfy-J <[email protected]>2019-11-03 18:33:41 +0300
committerWolfy-J <[email protected]>2019-11-03 18:33:41 +0300
commitfbf5e2e677b7c1f89114a29acdd834536316ab73 (patch)
tree9144467b4c0e3982ae23210b569226f65080c16c /service/container.go
parentb4b1d63e02895e241447b75bbe7f755191c47227 (diff)
- the ability to set custom command producer for roadrunner
- minor improvements in metrics service - List() function for Container to receive names of all available services
Diffstat (limited to 'service/container.go')
-rw-r--r--service/container.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/service/container.go b/service/container.go
index a21b49b4..06609ffc 100644
--- a/service/container.go
+++ b/service/container.go
@@ -46,6 +46,9 @@ type Container interface {
// Close all active services.
Stop()
+
+ // List service names.
+ List() []string
}
// Config provides ability to slice configuration sections and unmarshal configuration data into
@@ -212,6 +215,16 @@ func (c *container) Stop() {
}
}
+// List all service names.
+func (c *container) List() []string {
+ names := make([]string, 0)
+ for _, e := range c.services {
+ names = append(names, e.name)
+ }
+
+ return names
+}
+
// calls Init method with automatically resolved arguments.
func (c *container) initService(s interface{}, segment Config) (bool, error) {
r := reflect.TypeOf(s)