summaryrefslogtreecommitdiff
path: root/service/container.go
diff options
context:
space:
mode:
authorAnton Titov <[email protected]>2019-12-23 14:52:06 +0300
committerGitHub <[email protected]>2019-12-23 14:52:06 +0300
commit921e1f55e23ab75b8250045916c8d1ffad1b8bde (patch)
tree00b16331b9ff3b3b846ba22989dddde721cc959d /service/container.go
parent921354df1aa4687837e3ba6ac0eb04d39321c149 (diff)
parent2093cb9058f94668fff0a97beb76b0cab66c7b63 (diff)
Merge branch 'master' into Fix_warning_and_issues
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 b543ccb6..742b4c3b 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, len(c.services))
+ 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)