A bit more refactor to clean up the code.

This commit is contained in:
James Wells 2021-11-06 20:18:49 -07:00
parent 7e51584832
commit de41740bac
Signed by: jwells
GPG key ID: 73196D10B8E65666
5 changed files with 40 additions and 35 deletions

View file

@ -6,7 +6,7 @@ import (
http "net/http"
sync "sync"
gs "git.dragonheim.net/dragonheim/gagent/internal/gstructs"
gstructs "git.dragonheim.net/dragonheim/gagent/internal/gstructs"
prometheus "github.com/prometheus/client_golang/prometheus"
promauto "github.com/prometheus/client_golang/prometheus/promauto"
@ -27,12 +27,11 @@ var (
or client node. Tags are used by the agent to give hints as to where
it should be routed.
*/
func Main(wg *sync.WaitGroup, config gs.GagentConfig) {
defer wg.Done()
http.HandleFunc("/hello", answerClient)
func Main(wg *sync.WaitGroup, config gstructs.GagentConfig) {
log.Printf("[INFO] Starting router\n")
defer wg.Done()
http.HandleFunc("/hello", answerClient)
clientSock, _ := zmq.NewSocket(zmq.ROUTER)
defer clientSock.Close()