-
Notifications
You must be signed in to change notification settings - Fork 0
/
iconnection.go
34 lines (32 loc) · 1.75 KB
/
iconnection.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package database
import "github.com/lucacoratu/disertatie/api/data"
type IConnection interface {
Init() error
CheckUserExists(username string) (bool, error)
InsertUser(username string, password string) (string, error)
CheckUserCredentials(username string, password string) (bool, string, error)
CheckMachineExists(os string, hostname string) (string, error)
InsertMachine(os string, hostname string, ip_addresses []string) (string, error)
InsertAgent(protocol string, ip_address string, port string, webserver_protocol string, webserver_ip string, webserver_port string, machine_id string) (string, error)
GetCountAgents() (int64, error)
GetAgents() ([]data.Agent, error)
GetAgent(id string) (data.Agent, error)
ModifyAgent(id string, agent data.UpdateAgent) error
GetNumberMachinesAndNumberNetworkInterfaces() (int64, int64, error)
GetMachines() ([]data.MachineDatabase, error)
GetMachine(id string) (data.MachineInformation, error)
DeleteMachine(id string) error
GetAgentLogs(uuid string) ([]data.LogData, error)
GetAgentLogsShortPaginated(agent_id string, current_page string) (string, []data.LogDataShort, error)
GetAgentLogsShort(agent_id string) ([]data.LogDataShort, error)
GetLogsMethodCount(uuid string, method string) (int64, error)
GetRequestsPerDay(uuid string) (map[string]int64, error)
GetStatusCodeCounts(uuid string) (map[string]int64, error)
GetIPAddressesCounts(uuid string) (map[string]int64, error)
InsertLog(logData data.LogData) (string, bool, error)
GetLog(uuid string) (data.LogDataDatabase, error)
GetLogRequest(uuid string) (string, error)
GetLogFindings(log_uuid string) ([]data.FindingDatabase, error)
GetLogRuleFindings(log_uuid string) ([]data.RuleFindingDatabase, error)
CheckExploitCodeExists(log_uuid string) (bool, error)
}