Documentation ¶
Index ¶
Constants ¶
View Source
const ( WsError int64 = -1 WsNotification int64 = 1 WsAgentStatusRequest int64 = 2 WsAgentStatusResponse int64 = 3 WsAgentDisconnectedNotification int64 = 4 WsAgentConnectedNotification int64 = 5 WsRuleDetectionAlert int64 = 6 )
Message Types
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIWebSocketConnection ¶
type APIWebSocketConnection struct { State bool //The state of the websocket connection (true for active, false for inactive) // contains filtered or unexported fields }
func NewAPIWebSocketConnection ¶
func NewAPIWebSocketConnection(logger logging.ILogger, apiWsURL string, configuration config.Configuration) *APIWebSocketConnection
func (*APIWebSocketConnection) Connect ¶
func (awsc *APIWebSocketConnection) Connect() (bool, error)
Connects to the API websocket URL for the agent
func (*APIWebSocketConnection) SendNotification ¶
func (awsc *APIWebSocketConnection) SendNotification(message string) error
Function to send a notification to the API
func (*APIWebSocketConnection) SendRuleDetectionAlert ¶
func (awsc *APIWebSocketConnection) SendRuleDetectionAlert(alert RuleDetectionAlert) error
Function to send an alert when a high or critical payload is detected
func (*APIWebSocketConnection) Start ¶
func (awsc *APIWebSocketConnection) Start()
type AgentStatusRequest ¶
type AgentStatusRequest struct {
AgentId string `json:"agentId"`
}
type AgentStatusResponse ¶
type Notification ¶
Notification Websocket message
type RuleDetectionAlert ¶
type WebSocketMessage ¶
type WebSocketMessage struct { Type int64 `json:"type"` //The type of the message Data interface{} `json:"data"` //The data of the message as interface (can be any struct) }
WebSocket message format
Click to show internal directories.
Click to hide internal directories.