Updated structure

pull/637/head
kompotkot 2022-07-11 14:01:10 +00:00
rodzic bf1f33e683
commit cc0b25bf03
14 zmienionych plików z 17 dodań i 23 usunięć

1
nodes/.gitignore vendored
Wyświetl plik

@ -61,5 +61,4 @@ go.work
dev.env
prod.env
test.env
nodebalancer

Wyświetl plik

@ -58,7 +58,7 @@ echo
echo -e "${PREFIX_INFO} Building executable load balancer for nodes script with Go"
EXEC_DIR=$(pwd)
cd "${APP_NODES_DIR}/node_balancer"
HOME=/root /usr/local/go/bin/go build -o "${APP_NODES_DIR}/node_balancer/nodebalancer" "${APP_NODES_DIR}/node_balancer/main.go"
HOME=/root /usr/local/go/bin/go build -o "${APP_NODES_DIR}/node_balancer/nodebalancer" "${APP_NODES_DIR}/node_balancer/cmd/nodebalancer/*.go"
cd "${EXEC_DIR}"
echo

Wyświetl plik

@ -1,7 +1,7 @@
/*
Load balancer, based on https://github.com/kasvith/simplelb/
*/
package cmd
package main
import (
"encoding/json"

Wyświetl plik

@ -1,4 +1,4 @@
package cmd
package main
import (
"io/ioutil"

Wyświetl plik

@ -1,4 +1,4 @@
package cmd
package main
import (
"encoding/json"
@ -139,7 +139,6 @@ func (s *StateCLI) checkRequirements() {
}
config := configs.GetConfigPath(s.configPathFlag)
fmt.Println(config)
if !configs.CheckPathExists(config.ConfigPath) {
configs.GenerateDefaultConfig(config)
}

Wyświetl plik

@ -1,4 +1,4 @@
package cmd
package main
import (
"errors"
@ -23,7 +23,7 @@ type ClientResourceData struct {
Description string `json:"description"`
BlockchainAccess bool `json:"blockchain_access"`
ExtendedMethods bool `json:"extended_methods"`
LastAccessTs int64 `json:"last_access_ts"`
dataSource string

Wyświetl plik

@ -1,4 +1,4 @@
package cmd
package main
import (
"reflect"

Wyświetl plik

@ -1,4 +1,4 @@
package cmd
package main
import (
"database/sql"

Wyświetl plik

@ -0,0 +1,5 @@
package main
func main() {
CLI()
}

Wyświetl plik

@ -1,7 +1,7 @@
/*
Server API middleware.
*/
package cmd
package main
import (
"bytes"

Wyświetl plik

@ -1,7 +1,7 @@
/*
Handle routes for load balancer API.
*/
package cmd
package main
import (
"bytes"

Wyświetl plik

@ -1,7 +1,7 @@
/*
Node load balancer API server initialization.
*/
package cmd
package main
import (
"context"

Wyświetl plik

@ -5,6 +5,6 @@ set -e
PROGRAM_NAME="nodebalancer"
go build -o "$PROGRAM_NAME" .
go build -o "$PROGRAM_NAME" cmd/nodebalancer/*.go
./"$PROGRAM_NAME" "$@"

Wyświetl plik

@ -1,9 +0,0 @@
package main
import (
"github.com/bugout-dev/moonstream/nodes/node_balancer/cmd"
)
func main() {
cmd.CLI()
}