File tree 1 file changed +36
-0
lines changed
1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change @@ -108,6 +108,42 @@ There are several predefined by container service types that may be used as a de
108
108
inside service container between services or outside from the client code.
109
109
1 . The ` gontainer.Resolver ` service provides a service to resolve dependencies dynamically.
110
110
111
+ ### Container Interface
112
+
113
+ ``` go
114
+ // Container defines service container interface.
115
+ type Container interface {
116
+ // Start initializes every service in the container.
117
+ Start () error
118
+
119
+ // Close closes service container with all services.
120
+ // Blocks invocation until the container is closed.
121
+ Close () error
122
+
123
+ // Done is closing after closing of all services.
124
+ Done () <- chan struct {}
125
+
126
+ // Factories returns all defined factories.
127
+ Factories () []*Factory
128
+
129
+ // Services returns all spawned services.
130
+ Services () []any
131
+
132
+ // Events returns events broker instance.
133
+ Events () Events
134
+
135
+ // Resolver returns service resolver instance.
136
+ // If container is not started, only requested services
137
+ // will be spawned on `resolver.Resolve(...)` call.
138
+ Resolver () Resolver
139
+
140
+ // Invoke invokes specified function.
141
+ // If container is not started, only requested services
142
+ // will be spawned to invoke the func.
143
+ Invoke (fn any) ([]any, error )
144
+ }
145
+ ```
146
+
111
147
### Services
112
148
113
149
A service is a functional component of the application, created and managed by a Service Factory.
You can’t perform that action at this time.
0 commit comments