Skip to content

Commit

Permalink
Merge branch 'master' of github.com:pip-services3-go/pip-services3-co…
Browse files Browse the repository at this point in the history
…ntainer-go
  • Loading branch information
levichevdmitry committed Apr 9, 2021
2 parents f9296d7 + 2825f1b commit 46d198e
Show file tree
Hide file tree
Showing 12 changed files with 86 additions and 97 deletions.
23 changes: 11 additions & 12 deletions container/Container.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"errors"

cconfig "github.com/pip-services3-go/pip-services3-commons-go/config"
cconv "github.com/pip-services3-go/pip-services3-commons-go/convert"
cerr "github.com/pip-services3-go/pip-services3-commons-go/errors"
crefer "github.com/pip-services3-go/pip-services3-commons-go/refer"
cbuild "github.com/pip-services3-go/pip-services3-components-go/build"
Expand Down Expand Up @@ -59,19 +60,17 @@ Example
param2: XYZ
============================
container := NewEmptyContainer();
container.AddFactory(newMyComponentFactory());
container := NewEmptyContainer()
container.AddFactory(newMyComponentFactory())
parameters := NewConfigParamsFromValue(process.env);
container.ReadConfigFromFile("123", "./config/config.yml", parameters);
parameters := NewConfigParamsFromValue(process.env)
container.ReadConfigFromFile("123", "./config/config.yml", parameters)
container.Open("123", (err) => {
console.Log("Container is opened");
...
container.Close("123", (err) => {
console.Log("Container is closed");
});
});
err := container.Open("123")
ftm.Println("Container is opened")
...
err = container.Close("123")
fmt.Println("Container is closed")
*/
type Container struct {
logger log.ILogger
Expand Down Expand Up @@ -281,7 +280,7 @@ func (c *Container) Close(correlationId string) error {
if r := recover(); r != nil {
err, ok := r.(error)
if !ok {
msg, _ := r.(string)
msg := cconv.StringConverter.ToString(r)
err = errors.New(msg)
}
c.logger.Error(correlationId, err, "Failed to stop container")
Expand Down
Empty file modified docgen.ps1
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion docker/Dockerfile.build
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.13
FROM golang:1.16

# Set environment variables for Go
ENV GO111MODULE=on \
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile.docgen
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.13
FROM golang:1.16

# Set environment variables for Go
ENV GO111MODULE=on
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile.test
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.13
FROM golang:1.16

# Set environment variables for Go
ENV GO111MODULE=on \
Expand Down
8 changes: 4 additions & 4 deletions docs/pkg/config/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ <h3 id="ReadComponentConfigFromConfig">func <a href="http://localhost:6060/src/c



<h2 id="ContainerConfig">type <a href="http://localhost:6060/src/config/ContainerConfig.go?s=168:207#L1">ContainerConfig</a>
<h2 id="ContainerConfig">type <a href="http://localhost:6060/src/config/ContainerConfig.go?s=177:216#L2">ContainerConfig</a>
<a class="permalink" href="index.html#ContainerConfig">&#xb6;</a>


Expand All @@ -319,7 +319,7 @@ <h2 id="ContainerConfig">type <a href="http://localhost:6060/src/config/Containe



<h3 id="NewContainerConfig">func <a href="http://localhost:6060/src/config/ContainerConfig.go?s=380:451#L7">NewContainerConfig</a>
<h3 id="NewContainerConfig">func <a href="http://localhost:6060/src/config/ContainerConfig.go?s=389:460#L9">NewContainerConfig</a>
<a class="permalink" href="index.html#NewContainerConfig">&#xb6;</a>


Expand All @@ -340,7 +340,7 @@ <h3 id="NewContainerConfig">func <a href="http://localhost:6060/src/config/Conta



<h3 id="NewContainerConfigFromValue">func <a href="http://localhost:6060/src/config/ContainerConfig.go?s=850:917#L19">NewContainerConfigFromValue</a>
<h3 id="NewContainerConfigFromValue">func <a href="http://localhost:6060/src/config/ContainerConfig.go?s=859:926#L21">NewContainerConfigFromValue</a>
<a class="permalink" href="index.html#NewContainerConfigFromValue">&#xb6;</a>


Expand All @@ -364,7 +364,7 @@ <h3 id="NewContainerConfigFromValue">func <a href="http://localhost:6060/src/con



<h3 id="ReadContainerConfigFromConfig">func <a href="http://localhost:6060/src/config/ContainerConfig.go?s=1331:1419#L30">ReadContainerConfigFromConfig</a>
<h3 id="ReadContainerConfigFromConfig">func <a href="http://localhost:6060/src/config/ContainerConfig.go?s=1340:1428#L32">ReadContainerConfigFromConfig</a>
<a class="permalink" href="index.html#ReadContainerConfigFromConfig">&#xb6;</a>


Expand Down
62 changes: 30 additions & 32 deletions docs/pkg/container/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ <h2 class="toggleButton" title="Click to hide Index section">Index ▾</h2>
<dd>&nbsp; &nbsp; <a href="index.html#Container.Logger">func (c *Container) Logger() log.ILogger</a></dd>


<dd>&nbsp; &nbsp; <a href="index.html#Container.Open">func (c *Container) Open(correlationId string) error</a></dd>
<dd>&nbsp; &nbsp; <a href="index.html#Container.Open">func (c *Container) Open(correlationId string) (err error)</a></dd>


<dd>&nbsp; &nbsp; <a href="index.html#Container.ReadConfigFromFile">func (c *Container) ReadConfigFromFile(correlationId string, path string, parameters *cconfig.ConfigParams) error</a></dd>
Expand Down Expand Up @@ -204,7 +204,7 @@ <h3>Package files</h3>



<h2 id="Container">type <a href="http://localhost:6060/src/container/Container.go?s=2943:3238#L64">Container</a>
<h2 id="Container">type <a href="http://localhost:6060/src/container/Container.go?s=2971:3266#L65">Container</a>
<a class="permalink" href="index.html#Container">&#xb6;</a>


Expand Down Expand Up @@ -267,19 +267,17 @@ <h2 id="Container">type <a href="http://localhost:6060/src/container/Container.g
param2: XYZ
============================

container := NewEmptyContainer();
container.AddFactory(newMyComponentFactory());
container := NewEmptyContainer()
container.AddFactory(newMyComponentFactory())

parameters := NewConfigParamsFromValue(process.env);
container.ReadConfigFromFile(&#34;123&#34;, &#34;./config/config.yml&#34;, parameters);
parameters := NewConfigParamsFromValue(process.env)
container.ReadConfigFromFile(&#34;123&#34;, &#34;./config/config.yml&#34;, parameters)

container.Open(&#34;123&#34;, (err) =&gt; {
console.Log(&#34;Container is opened&#34;);
...
container.Close(&#34;123&#34;, (err) =&gt; {
console.Log(&#34;Container is closed&#34;);
});
});
err := container.Open(&#34;123&#34;)
ftm.Println(&#34;Container is opened&#34;)
...
err = container.Close(&#34;123&#34;)
fmt.Println(&#34;Container is closed&#34;)
</pre>

<pre>type Container struct {
Expand All @@ -297,7 +295,7 @@ <h2 id="Container">type <a href="http://localhost:6060/src/container/Container.g



<h3 id="InheritContainer">func <a href="http://localhost:6060/src/container/Container.go?s=4225:4328#L109">InheritContainer</a>
<h3 id="InheritContainer">func <a href="http://localhost:6060/src/container/Container.go?s=4253:4356#L110">InheritContainer</a>
<a class="permalink" href="index.html#InheritContainer">&#xb6;</a>


Expand All @@ -323,7 +321,7 @@ <h3 id="InheritContainer">func <a href="http://localhost:6060/src/container/Cont



<h3 id="NewContainer">func <a href="http://localhost:6060/src/container/Container.go?s=3726:3787#L91">NewContainer</a>
<h3 id="NewContainer">func <a href="http://localhost:6060/src/container/Container.go?s=3754:3815#L92">NewContainer</a>
<a class="permalink" href="index.html#NewContainer">&#xb6;</a>


Expand All @@ -346,7 +344,7 @@ <h3 id="NewContainer">func <a href="http://localhost:6060/src/container/Containe



<h3 id="NewEmptyContainer">func <a href="http://localhost:6060/src/container/Container.go?s=3312:3347#L76">NewEmptyContainer</a>
<h3 id="NewEmptyContainer">func <a href="http://localhost:6060/src/container/Container.go?s=3340:3375#L77">NewEmptyContainer</a>
<a class="permalink" href="index.html#NewEmptyContainer">&#xb6;</a>


Expand All @@ -363,7 +361,7 @@ <h3 id="NewEmptyContainer">func <a href="http://localhost:6060/src/container/Con



<h3 id="Container.AddFactory">func (*Container) <a href="http://localhost:6060/src/container/Container.go?s=6364:6419#L181">AddFactory</a>
<h3 id="Container.AddFactory">func (*Container) <a href="http://localhost:6060/src/container/Container.go?s=6392:6447#L182">AddFactory</a>
<a class="permalink" href="index.html#Container.AddFactory">&#xb6;</a>


Expand All @@ -382,7 +380,7 @@ <h3 id="Container.AddFactory">func (*Container) <a href="http://localhost:6060/s



<h3 id="Container.Close">func (*Container) <a href="http://localhost:6060/src/container/Container.go?s=8206:8259#L252">Close</a>
<h3 id="Container.Close">func (*Container) <a href="http://localhost:6060/src/container/Container.go?s=8390:8443#L261">Close</a>
<a class="permalink" href="index.html#Container.Close">&#xb6;</a>


Expand All @@ -404,7 +402,7 @@ <h3 id="Container.Close">func (*Container) <a href="http://localhost:6060/src/co



<h3 id="Container.Configure">func (*Container) <a href="http://localhost:6060/src/container/Container.go?s=4677:4734#L125">Configure</a>
<h3 id="Container.Configure">func (*Container) <a href="http://localhost:6060/src/container/Container.go?s=4705:4762#L126">Configure</a>
<a class="permalink" href="index.html#Container.Configure">&#xb6;</a>


Expand All @@ -423,7 +421,7 @@ <h3 id="Container.Configure">func (*Container) <a href="http://localhost:6060/sr



<h3 id="Container.Info">func (*Container) <a href="http://localhost:6060/src/container/Container.go?s=6091:6135#L173">Info</a>
<h3 id="Container.Info">func (*Container) <a href="http://localhost:6060/src/container/Container.go?s=6119:6163#L174">Info</a>
<a class="permalink" href="index.html#Container.Info">&#xb6;</a>


Expand All @@ -435,7 +433,7 @@ <h3 id="Container.Info">func (*Container) <a href="http://localhost:6060/src/con



<h3 id="Container.IsOpen">func (*Container) <a href="http://localhost:6060/src/container/Container.go?s=6567:6600#L188">IsOpen</a>
<h3 id="Container.IsOpen">func (*Container) <a href="http://localhost:6060/src/container/Container.go?s=6595:6628#L189">IsOpen</a>
<a class="permalink" href="index.html#Container.IsOpen">&#xb6;</a>


Expand All @@ -452,7 +450,7 @@ <h3 id="Container.IsOpen">func (*Container) <a href="http://localhost:6060/src/c



<h3 id="Container.Logger">func (*Container) <a href="http://localhost:6060/src/container/Container.go?s=5954:5994#L165">Logger</a>
<h3 id="Container.Logger">func (*Container) <a href="http://localhost:6060/src/container/Container.go?s=5982:6022#L166">Logger</a>
<a class="permalink" href="index.html#Container.Logger">&#xb6;</a>


Expand All @@ -464,12 +462,12 @@ <h3 id="Container.Logger">func (*Container) <a href="http://localhost:6060/src/c



<h3 id="Container.Open">func (*Container) <a href="http://localhost:6060/src/container/Container.go?s=6777:6829#L197">Open</a>
<h3 id="Container.Open">func (*Container) <a href="http://localhost:6060/src/container/Container.go?s=6805:6863#L198">Open</a>
<a class="permalink" href="index.html#Container.Open">&#xb6;</a>


</h3>
<pre>func (c *<a href="index.html#Container">Container</a>) Open(correlationId <a href="http://localhost:6060/pkg/builtin/#string">string</a>) <a href="http://localhost:6060/pkg/builtin/#error">error</a></pre>
<pre>func (c *<a href="index.html#Container">Container</a>) Open(correlationId <a href="http://localhost:6060/pkg/builtin/#string">string</a>) (err <a href="http://localhost:6060/pkg/builtin/#error">error</a>)</pre>
<p>
Opens the component.
Parameters:
Expand All @@ -486,7 +484,7 @@ <h3 id="Container.Open">func (*Container) <a href="http://localhost:6060/src/con



<h3 id="Container.ReadConfigFromFile">func (*Container) <a href="http://localhost:6060/src/container/Container.go?s=5165:5279#L137">ReadConfigFromFile</a>
<h3 id="Container.ReadConfigFromFile">func (*Container) <a href="http://localhost:6060/src/container/Container.go?s=5193:5307#L138">ReadConfigFromFile</a>
<a class="permalink" href="index.html#Container.ReadConfigFromFile">&#xb6;</a>


Expand All @@ -512,7 +510,7 @@ <h3 id="Container.ReadConfigFromFile">func (*Container) <a href="http://localhos



<h3 id="Container.SetLogger">func (*Container) <a href="http://localhost:6060/src/container/Container.go?s=6017:6066#L169">SetLogger</a>
<h3 id="Container.SetLogger">func (*Container) <a href="http://localhost:6060/src/container/Container.go?s=6045:6094#L170">SetLogger</a>
<a class="permalink" href="index.html#Container.SetLogger">&#xb6;</a>


Expand All @@ -526,7 +524,7 @@ <h3 id="Container.SetLogger">func (*Container) <a href="http://localhost:6060/sr



<h2 id="ProcessContainer">type <a href="http://localhost:6060/src/container/ProcessContainer.go?s=890:952#L21">ProcessContainer</a>
<h2 id="ProcessContainer">type <a href="http://localhost:6060/src/container/ProcessContainer.go?s=898:960#L22">ProcessContainer</a>
<a class="permalink" href="index.html#ProcessContainer">&#xb6;</a>


Expand Down Expand Up @@ -570,7 +568,7 @@ <h2 id="ProcessContainer">type <a href="http://localhost:6060/src/container/Proc



<h3 id="InheritProcessContainer">func <a href="http://localhost:6060/src/container/ProcessContainer.go?s=2057:2174#L62">InheritProcessContainer</a>
<h3 id="InheritProcessContainer">func <a href="http://localhost:6060/src/container/ProcessContainer.go?s=2065:2182#L63">InheritProcessContainer</a>
<a class="permalink" href="index.html#InheritProcessContainer">&#xb6;</a>


Expand All @@ -596,7 +594,7 @@ <h3 id="InheritProcessContainer">func <a href="http://localhost:6060/src/contain



<h3 id="NewEmptyProcessContainer">func <a href="http://localhost:6060/src/container/ProcessContainer.go?s=1032:1081#L28">NewEmptyProcessContainer</a>
<h3 id="NewEmptyProcessContainer">func <a href="http://localhost:6060/src/container/ProcessContainer.go?s=1040:1089#L29">NewEmptyProcessContainer</a>
<a class="permalink" href="index.html#NewEmptyProcessContainer">&#xb6;</a>


Expand All @@ -611,7 +609,7 @@ <h3 id="NewEmptyProcessContainer">func <a href="http://localhost:6060/src/contai



<h3 id="NewProcessContainer">func <a href="http://localhost:6060/src/container/ProcessContainer.go?s=1476:1551#L44">NewProcessContainer</a>
<h3 id="NewProcessContainer">func <a href="http://localhost:6060/src/container/ProcessContainer.go?s=1484:1559#L45">NewProcessContainer</a>
<a class="permalink" href="index.html#NewProcessContainer">&#xb6;</a>


Expand All @@ -636,7 +634,7 @@ <h3 id="NewProcessContainer">func <a href="http://localhost:6060/src/container/P



<h3 id="ProcessContainer.Run">func (*ProcessContainer) <a href="http://localhost:6060/src/container/ProcessContainer.go?s=4719:4764#L172">Run</a>
<h3 id="ProcessContainer.Run">func (*ProcessContainer) <a href="http://localhost:6060/src/container/ProcessContainer.go?s=4792:4837#L177">Run</a>
<a class="permalink" href="index.html#ProcessContainer.Run">&#xb6;</a>


Expand All @@ -656,7 +654,7 @@ <h3 id="ProcessContainer.Run">func (*ProcessContainer) <a href="http://localhost



<h3 id="ProcessContainer.SetConfigPath">func (*ProcessContainer) <a href="http://localhost:6060/src/container/ProcessContainer.go?s=2394:2453#L73">SetConfigPath</a>
<h3 id="ProcessContainer.SetConfigPath">func (*ProcessContainer) <a href="http://localhost:6060/src/container/ProcessContainer.go?s=2402:2461#L74">SetConfigPath</a>
<a class="permalink" href="index.html#ProcessContainer.SetConfigPath">&#xb6;</a>


Expand Down
Loading

0 comments on commit 46d198e

Please sign in to comment.