summaryrefslogtreecommitdiff
path: root/service/container.go
diff options
context:
space:
mode:
authorAnton Titov <[email protected]>2019-12-23 12:04:12 +0300
committerGitHub <[email protected]>2019-12-23 12:04:12 +0300
commit7f694966730f6dac09d0d0ea3bf51276b8e4dfe4 (patch)
tree55d584785e87aef8ee15f5ab5f01c22d50754397 /service/container.go
parentfadf373c1fe5e51bfaeb9e5ac3fe4ee748620a44 (diff)
parent028ff585f8f8a42f4796afdb932f97eee6eb8f4c (diff)
Merge pull request #204 from spiral/feature/hotreload
[wip] Hot-reloading capabilities - review wanted
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..0be4f853 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)