Skip to content

Commit

Permalink
comments
Browse files Browse the repository at this point in the history
  • Loading branch information
miiu96 committed Nov 10, 2023
1 parent 280d30c commit 21bb8cd
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/pr-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.17.6
go-version: 1.20.7
id: go

- name: Check out code into the Go module directory
Expand Down
3 changes: 3 additions & 0 deletions pkg/proxy/configs.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,21 @@ import (
"github.com/multiversx/mx-chain-proxy-go/data"
)

// ArgsProxyConfigs holds the arguments needed to create the proxy configs
type ArgsProxyConfigs struct {
TemDir string
PathToProxyConfig string
ServerPort int
RestApiInterfaces map[uint32]string
}

// ArgsOutputConfig holds the output arguments for proxy configs
type ArgsOutputConfig struct {
Config *config.Config
PathToTempConfig string
}

// CreateProxyConfigs will create the proxy configs
func CreateProxyConfigs(args ArgsProxyConfigs) (*ArgsOutputConfig, error) {
newConfigsPath := path.Join(args.TemDir, "proxyConfig")

Expand Down
3 changes: 3 additions & 0 deletions pkg/proxy/creator.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (

var log = logger.GetOrCreate("proxy")

// ArgsProxy holds the arguments needed to create a new instance of proxy
type ArgsProxy struct {
Config *config.Config
NodeHandler process.NodeHandler
Expand All @@ -36,6 +37,7 @@ type proxy struct {
httpServer *http.Server
}

// CreateProxy will create a new instance of proxy
func CreateProxy(args ArgsProxy) (ProxyHandler, error) {
proxyInstance := &proxy{
closableComponents: data.NewClosableComponentsHandler(),
Expand Down Expand Up @@ -214,6 +216,7 @@ func CreateProxy(args ArgsProxy) (ProxyHandler, error) {
return proxyInstance, nil
}

// Close will close the proxy
func (p *proxy) Close() {
p.closableComponents.Close()
}
1 change: 1 addition & 0 deletions pkg/proxy/interface.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package proxy

// ProxyHandler defines what a proxy handler should be able to do
type ProxyHandler interface {
Close()
}

0 comments on commit 21bb8cd

Please sign in to comment.