diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..7a0bc4a --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,23 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "houston", + "type": "go", + "request": "launch", + "mode": "auto", + "program": "${workspaceFolder}/houston", + "env": { + }, + "args" : [ + "-config=./config_template.json", + "-dev", + "-nosession=true", + "-port=8080" + ] + } + ] +} \ No newline at end of file diff --git a/client/client.go b/client/client.go index 84ed3ed..c5fb86f 100644 --- a/client/client.go +++ b/client/client.go @@ -12,7 +12,7 @@ import ( "sync/atomic" "unsafe" - "repositories.action2quare.com/ayo/go-ayo/logger" + "repositories.action2quare.com/ayo/gocommon/logger" "repositories.action2quare.com/ayo/houston/shared" "repositories.action2quare.com/ayo/houston/shared/protos" diff --git a/client/deploy.go b/client/deploy.go index 12a5d11..91afc1f 100644 --- a/client/deploy.go +++ b/client/deploy.go @@ -13,7 +13,7 @@ import ( "path" "strings" - "repositories.action2quare.com/ayo/go-ayo/logger" + "repositories.action2quare.com/ayo/gocommon/logger" "repositories.action2quare.com/ayo/houston/shared" "repositories.action2quare.com/ayo/houston/shared/protos" diff --git a/client/operation.go b/client/operation.go index 9343c14..a708f9d 100644 --- a/client/operation.go +++ b/client/operation.go @@ -17,7 +17,7 @@ import ( "syscall" "time" - "repositories.action2quare.com/ayo/go-ayo/logger" + "repositories.action2quare.com/ayo/gocommon/logger" "repositories.action2quare.com/ayo/houston/shared" "repositories.action2quare.com/ayo/houston/shared/protos" diff --git a/go.mod b/go.mod index cf90542..cf31a8f 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,7 @@ require ( golang.org/x/text v0.9.0 google.golang.org/grpc v1.55.0 google.golang.org/protobuf v1.30.0 - repositories.action2quare.com/ayo/go-ayo v0.0.0-20230521165809-09cee56768c5 + repositories.action2quare.com/ayo/gocommon v0.0.0-20230524061015-e95efa06a6d4 ) require ( diff --git a/go.sum b/go.sum index 916bab2..90afe2a 100644 --- a/go.sum +++ b/go.sum @@ -148,5 +148,5 @@ gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -repositories.action2quare.com/ayo/go-ayo v0.0.0-20230521165809-09cee56768c5 h1:EobNJQwZ/TyRRtXY9XhJslN80V+sKoAztsda3x+ISE0= -repositories.action2quare.com/ayo/go-ayo v0.0.0-20230521165809-09cee56768c5/go.mod h1:3gLLbyiq4cOEraSiY6wpYWdcWRPcQKIcs0TfQ/Vwhoc= +repositories.action2quare.com/ayo/gocommon v0.0.0-20230524061015-e95efa06a6d4 h1:DFrkLvbPWqwVDU4X0QGJs2lhPduJYJU+JM/r1L2RMwo= +repositories.action2quare.com/ayo/gocommon v0.0.0-20230524061015-e95efa06a6d4/go.mod h1:pw573a06qV7dP1lSyavbWmzyYAsmwtK6mdbFENbh3cs= diff --git a/houston_test.go b/houston_test.go index a8a9db1..fb3d71b 100644 --- a/houston_test.go +++ b/houston_test.go @@ -8,7 +8,11 @@ import ( ) func TestOperationServer(t *testing.T) { - hc, _ := client.NewClient("localhost:8080", "http://localhost/commandcenter") + hc, err := client.NewClient("192.168.9.32:8080", "http://192.168.9.32/commandcenter") + if err != nil { + t.Error(err) + return + } for i := 0; ; i++ { hc.SetReportMetrics(map[string]float32{ "count": float32(i), diff --git a/server/http_api.go b/server/http_api.go index 2791412..508757a 100644 --- a/server/http_api.go +++ b/server/http_api.go @@ -9,10 +9,15 @@ import ( "strconv" "time" - "repositories.action2quare.com/ayo/go-ayo/logger" + "repositories.action2quare.com/ayo/gocommon/logger" "repositories.action2quare.com/ayo/houston/shared" ) +/* +* +현재 접속 중인 Agent 목록을 보여줍니다. +- http method : GET +*/ func (h *houstonHandler) GetAgents(w http.ResponseWriter, r *http.Request) { enc := json.NewEncoder(w) enc.Encode(h.Operation().Hosts()) diff --git a/server/http_handler.go b/server/http_handler.go index 10d976a..5cbdfff 100644 --- a/server/http_handler.go +++ b/server/http_handler.go @@ -10,7 +10,7 @@ import ( "runtime/debug" "strings" - "repositories.action2quare.com/ayo/go-ayo/logger" + "repositories.action2quare.com/ayo/gocommon/logger" ) const ( diff --git a/server/operation.go b/server/operation.go index 4412112..7af56ab 100644 --- a/server/operation.go +++ b/server/operation.go @@ -7,7 +7,7 @@ import ( "reflect" "sync" - "repositories.action2quare.com/ayo/go-ayo/logger" + "repositories.action2quare.com/ayo/gocommon/logger" "repositories.action2quare.com/ayo/houston/shared" "repositories.action2quare.com/ayo/houston/shared/protos"