-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
122 additions
and
10 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,13 @@ | ||
package model | ||
|
||
type Agents struct { | ||
ID uint `gorm:"primaryKey,autoIncrement"` | ||
UUID string `gorm:"type:char(36);not null;"` | ||
Shells []string `gorm:"shells"` | ||
Name string `gorm:"not null"` | ||
IP string `gorm:"not null"` | ||
Status string `gorm:"type:enum('UP','ERROR','UNKNOWN');default:'DOWN'"` | ||
CreatedAt *string `gorm:"type:datetime(0);not null"` | ||
UpdatedAt *string `gorm:"type:datetime(0);not null"` | ||
DeletedAt *string `gorm:"type:datetime(0)"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,13 @@ | ||
package request | ||
|
||
type AgentRequest struct { | ||
Agent Agent `json:"agent"` | ||
} | ||
|
||
type Agent struct { | ||
ID string `json:"id"` | ||
UUID string `json:"uuid"` | ||
Name string `json:"name" validate:"required"` | ||
IP string `json:"ip" validate:"required"` | ||
Status string `json:"status"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package request | ||
|
||
type CommandRequest struct { | ||
Command Command `json:"command"` | ||
} | ||
|
||
type Command struct { | ||
AgentUUID string `json:"agent_uuid"` | ||
AgentName string `json:"agent_name"` | ||
Body []CommandBody `json:"body"` | ||
} | ||
|
||
type CommandBody struct { | ||
Environments string `json:"environments"` | ||
Shell string `json:"shell"` | ||
Args string `json:"args"` | ||
Timeout int `json:"timeout"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,16 @@ | ||
package response | ||
|
||
type CommandResponse struct { | ||
Command Command `json:"command"` | ||
} | ||
|
||
type Command struct { | ||
AgentUUID string `json:"agent_uuid"` | ||
AgentName string `json:"agent_name"` | ||
Results []CommandResult `json:"results"` | ||
} | ||
|
||
type CommandResult struct { | ||
Code string `json:"code"` | ||
Message string `json:"message"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters