mirror of
https://github.com/dragonheim/gagent.git
synced 2025-04-28 10:18:58 -07:00
minor cleanup and standardization of package names.
This commit is contained in:
parent
3bb7096625
commit
d13a309593
9 changed files with 38 additions and 38 deletions
|
@ -13,7 +13,7 @@ import (
|
|||
sync "sync"
|
||||
time "time"
|
||||
|
||||
gstructs "github.com/dragonheim/gagent/internal/gstructs"
|
||||
gs "github.com/dragonheim/gagent/internal/gstructs"
|
||||
|
||||
zmq "github.com/pebbe/zmq4"
|
||||
)
|
||||
|
@ -26,11 +26,11 @@ import (
|
|||
* of it's most recent request.
|
||||
* Main is the entrypoint for the client process
|
||||
*/
|
||||
func Main(wg *sync.WaitGroup, config gstructs.GagentConfig) {
|
||||
func Main(wg *sync.WaitGroup, config gs.GagentConfig) {
|
||||
log.Printf("[INFO] Starting client\n")
|
||||
defer wg.Done()
|
||||
|
||||
var agent gstructs.AgentDetails
|
||||
var agent gs.AgentDetails
|
||||
var err error
|
||||
|
||||
if config.CMode {
|
||||
|
@ -67,7 +67,7 @@ func Main(wg *sync.WaitGroup, config gstructs.GagentConfig) {
|
|||
/*
|
||||
* Parse Agent file for GHINT data to populate the G'Agent hints
|
||||
*/
|
||||
func getTagsFromHints(agent gstructs.AgentDetails) []string {
|
||||
func getTagsFromHints(agent gs.AgentDetails) []string {
|
||||
var tags []string
|
||||
|
||||
// Use named capture groups to extract the hints
|
||||
|
@ -89,7 +89,7 @@ func getTagsFromHints(agent gstructs.AgentDetails) []string {
|
|||
return tags
|
||||
}
|
||||
|
||||
func sendAgent(wg *sync.WaitGroup, uuid string, connectString string, agent gstructs.AgentDetails) {
|
||||
func sendAgent(wg *sync.WaitGroup, uuid string, connectString string, agent gs.AgentDetails) {
|
||||
defer wg.Done()
|
||||
|
||||
var mu sync.Mutex
|
||||
|
|
|
@ -9,7 +9,8 @@ import (
|
|||
"sync"
|
||||
"testing"
|
||||
|
||||
gstructs "github.com/dragonheim/gagent/internal/gstructs"
|
||||
gs "github.com/dragonheim/gagent/internal/gstructs"
|
||||
|
||||
zmq "github.com/pebbe/zmq4"
|
||||
)
|
||||
|
||||
|
@ -41,7 +42,7 @@ func (m *mockSocket) Events() zmq.State
|
|||
func (m *mockSocket) String() string { return "" }
|
||||
|
||||
func TestGetTagsFromHints(t *testing.T) {
|
||||
agent := gstructs.AgentDetails{
|
||||
agent := gs.AgentDetails{
|
||||
Script: []byte(`*set GHINT[split "tag1,tag2,tag3",]`),
|
||||
}
|
||||
|
||||
|
@ -55,10 +56,10 @@ func TestGetTagsFromHints(t *testing.T) {
|
|||
|
||||
func TestSendAgent(t *testing.T) {
|
||||
wg := &sync.WaitGroup{}
|
||||
config := gstructs.GagentConfig{
|
||||
config := gs.GagentConfig{
|
||||
UUID: "test-uuid",
|
||||
ClientPort: 1234,
|
||||
Routers: map[string]gstructs.Router{
|
||||
Routers: map[string]gs.Router{
|
||||
"test-router": {
|
||||
RouterAddr: "127.0.0.1",
|
||||
ClientPort: 1234,
|
||||
|
@ -66,7 +67,7 @@ func TestSendAgent(t *testing.T) {
|
|||
},
|
||||
}
|
||||
|
||||
agent := gstructs.AgentDetails{
|
||||
agent := gs.AgentDetails{
|
||||
Client: "test-client",
|
||||
Script: []byte(`*set GHINT[split "tag1,tag2,tag3",]`),
|
||||
}
|
||||
|
@ -120,12 +121,12 @@ func TestMain(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
config := gstructs.GagentConfig{
|
||||
config := gs.GagentConfig{
|
||||
CMode: true,
|
||||
UUID: "test-uuid",
|
||||
ClientPort: 1234,
|
||||
Agent: tmpAgentFile.Name(),
|
||||
Routers: map[string]gstructs.Router{
|
||||
Routers: map[string]gs.Router{
|
||||
"test-router": {
|
||||
RouterAddr: "127.0.0.1",
|
||||
ClientPort: 1234,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue