■ ■ ■ ■ ■ ■
internal/app/api/agent.go
| skipped 58 lines |
59 | 59 | | } |
60 | 60 | | |
61 | 61 | | func GetCommands(agent string) []byte { |
62 | | - | //query := bson.M{} |
63 | 62 | | |
64 | 63 | | session, err := mgo.Dial("127.0.0.1") |
65 | 64 | | if err != nil { |
| skipped 22 lines |
88 | 87 | | } |
89 | 88 | | |
90 | 89 | | func GetCommandsOut(agent string, cmdid string) []byte { |
91 | | - | //query := bson.M{} |
92 | 90 | | |
93 | 91 | | session, err := mgo.Dial("127.0.0.1") |
94 | 92 | | if err != nil { |
| skipped 22 lines |
117 | 115 | | } |
118 | 116 | | |
119 | 117 | | func GetAgent(agent string) []byte { |
120 | | - | fmt.Println("GetAgent") |
121 | | - | //query := bson.M{} |
122 | 118 | | |
123 | 119 | | session, err := mgo.Dial("127.0.0.1") |
124 | 120 | | if err != nil { |
| skipped 61 lines |
186 | 182 | | |
187 | 183 | | //UpdateAgentStatus update agent last checkin and current working directory |
188 | 184 | | func UpdateAgentStatus(agent string, working string, files string) { |
189 | | - | //_id, _ := primitive.ObjectIDFromHex(id) |
190 | 185 | | now := time.Now() |
191 | 186 | | fmt.Println("Updating") |
192 | 187 | | fmt.Println(agent) |
| skipped 49 lines |