kopia lustrzana https://github.com/bugout-dev/moonstream
Updated structure
rodzic
bf1f33e683
commit
cc0b25bf03
|
@ -61,5 +61,4 @@ go.work
|
||||||
dev.env
|
dev.env
|
||||||
prod.env
|
prod.env
|
||||||
test.env
|
test.env
|
||||||
nodebalancer
|
|
||||||
|
|
||||||
|
|
|
@ -58,7 +58,7 @@ echo
|
||||||
echo -e "${PREFIX_INFO} Building executable load balancer for nodes script with Go"
|
echo -e "${PREFIX_INFO} Building executable load balancer for nodes script with Go"
|
||||||
EXEC_DIR=$(pwd)
|
EXEC_DIR=$(pwd)
|
||||||
cd "${APP_NODES_DIR}/node_balancer"
|
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}"
|
cd "${EXEC_DIR}"
|
||||||
|
|
||||||
echo
|
echo
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
Load balancer, based on https://github.com/kasvith/simplelb/
|
Load balancer, based on https://github.com/kasvith/simplelb/
|
||||||
*/
|
*/
|
||||||
package cmd
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
|
@ -1,4 +1,4 @@
|
||||||
package cmd
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"io/ioutil"
|
"io/ioutil"
|
|
@ -1,4 +1,4 @@
|
||||||
package cmd
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
@ -139,7 +139,6 @@ func (s *StateCLI) checkRequirements() {
|
||||||
}
|
}
|
||||||
|
|
||||||
config := configs.GetConfigPath(s.configPathFlag)
|
config := configs.GetConfigPath(s.configPathFlag)
|
||||||
fmt.Println(config)
|
|
||||||
if !configs.CheckPathExists(config.ConfigPath) {
|
if !configs.CheckPathExists(config.ConfigPath) {
|
||||||
configs.GenerateDefaultConfig(config)
|
configs.GenerateDefaultConfig(config)
|
||||||
}
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
package cmd
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
|
@ -23,7 +23,7 @@ type ClientResourceData struct {
|
||||||
Description string `json:"description"`
|
Description string `json:"description"`
|
||||||
BlockchainAccess bool `json:"blockchain_access"`
|
BlockchainAccess bool `json:"blockchain_access"`
|
||||||
ExtendedMethods bool `json:"extended_methods"`
|
ExtendedMethods bool `json:"extended_methods"`
|
||||||
|
|
||||||
LastAccessTs int64 `json:"last_access_ts"`
|
LastAccessTs int64 `json:"last_access_ts"`
|
||||||
|
|
||||||
dataSource string
|
dataSource string
|
|
@ -1,4 +1,4 @@
|
||||||
package cmd
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"reflect"
|
"reflect"
|
|
@ -1,4 +1,4 @@
|
||||||
package cmd
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"database/sql"
|
"database/sql"
|
|
@ -0,0 +1,5 @@
|
||||||
|
package main
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
CLI()
|
||||||
|
}
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
Server API middleware.
|
Server API middleware.
|
||||||
*/
|
*/
|
||||||
package cmd
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
Handle routes for load balancer API.
|
Handle routes for load balancer API.
|
||||||
*/
|
*/
|
||||||
package cmd
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
Node load balancer API server initialization.
|
Node load balancer API server initialization.
|
||||||
*/
|
*/
|
||||||
package cmd
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
|
@ -5,6 +5,6 @@ set -e
|
||||||
|
|
||||||
PROGRAM_NAME="nodebalancer"
|
PROGRAM_NAME="nodebalancer"
|
||||||
|
|
||||||
go build -o "$PROGRAM_NAME" .
|
go build -o "$PROGRAM_NAME" cmd/nodebalancer/*.go
|
||||||
|
|
||||||
./"$PROGRAM_NAME" "$@"
|
./"$PROGRAM_NAME" "$@"
|
||||||
|
|
|
@ -1,9 +0,0 @@
|
||||||
package main
|
|
||||||
|
|
||||||
import (
|
|
||||||
"github.com/bugout-dev/moonstream/nodes/node_balancer/cmd"
|
|
||||||
)
|
|
||||||
|
|
||||||
func main() {
|
|
||||||
cmd.CLI()
|
|
||||||
}
|
|
Ładowanie…
Reference in New Issue