ws

package
v1.3.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 19, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuditRequestedPayload added in v0.3.0

type AuditRequestedPayload struct {
	AuditID int64 `json:"audit_id"`
}

AuditRequestedPayload matches the broadcastWith() from AuditRequested event.

type BanCreatedPayload

type BanCreatedPayload struct {
	ID        int64   `json:"id"`
	IPAddress string  `json:"ip_address"`
	Reason    string  `json:"reason"`
	AgentID   *int64  `json:"agent_id"`
	ExpiresAt *string `json:"expires_at"`
}

BanCreatedPayload matches the broadcastWith() from BanCreated event.

type BanRemovedPayload

type BanRemovedPayload struct {
	ID        int64  `json:"id"`
	IPAddress string `json:"ip_address"`
	AgentID   *int64 `json:"agent_id"`
}

BanRemovedPayload matches the broadcastWith() from BanRemoved event.

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client manages the WebSocket connection to Reverb.

func New

func New(reverbURL, appKey, authEndpoint, agentToken string, agentID int64, h Handlers) *Client

func (*Client) Run

func (c *Client) Run()

Run connects and reconnects with exponential backoff. Blocks indefinitely.

type Handlers

type Handlers struct {
	OnBanCreated           func(BanCreatedPayload)
	OnBanRemoved           func(BanRemovedPayload)
	OnRuleCreated          func(RuleCreatedPayload)
	OnRuleRemoved          func(RuleRemovedPayload)
	OnScanRequested        func(ScanRequestedPayload)
	OnImportRequested      func(ImportRequestedPayload)
	OnAuditRequested       func(AuditRequestedPayload)
	OnSyncRequested        func(SyncRequestedPayload)
	OnUpdateRequested      func(UpdateRequestedPayload)
	OnMalwareScanRequested func(MalwareScanRequestedPayload)
	OnYaraInstallRequested func(YaraInstallRequestedPayload)
}

Handlers called when events are received from the server.

type ImportRequestedPayload added in v0.2.0

type ImportRequestedPayload struct {
	AgentID int64 `json:"agent_id"`
}

ImportRequestedPayload matches the broadcastWith() from ImportRequested event.

type MalwareScanRequestedPayload added in v0.9.93

type MalwareScanRequestedPayload struct {
	AgentID   int64  `json:"agent_id"`
	Intensity string `json:"intensity"` // "low", "medium", "high"
}

MalwareScanRequestedPayload matches the broadcastWith() from MalwareScanRequested event.

type RuleCreatedPayload

type RuleCreatedPayload struct {
	ID        int64   `json:"id"`
	Type      string  `json:"type"`
	Protocol  string  `json:"protocol"`
	IPAddress *string `json:"ip_address"`
	IPRange   *string `json:"ip_range"`
	Port      *int    `json:"port"`
	Status    string  `json:"status"`
	AgentID   *int64  `json:"agent_id"`
}

RuleCreatedPayload matches the broadcastWith() from RuleCreated event.

type RuleRemovedPayload

type RuleRemovedPayload struct {
	ID      int64  `json:"id"`
	AgentID *int64 `json:"agent_id"`
}

RuleRemovedPayload matches the broadcastWith() from RuleRemoved event.

type ScanRequestedPayload

type ScanRequestedPayload struct {
	ScanID int64 `json:"scan_id"`
}

ScanRequestedPayload matches the broadcastWith() from ScanRequested event.

type SyncRequestedPayload added in v0.9.16

type SyncRequestedPayload struct {
	AgentID int64 `json:"agent_id"`
}

SyncRequestedPayload matches the broadcastWith() from SyncRequested event.

type UpdateRequestedPayload added in v0.6.1

type UpdateRequestedPayload struct {
	AgentID int64 `json:"agent_id"`
}

UpdateRequestedPayload matches the broadcastWith() from UpdateRequested event.

type YaraInstallRequestedPayload added in v0.9.100

type YaraInstallRequestedPayload struct {
	AgentID int64 `json:"agent_id"`
}

YaraInstallRequestedPayload matches the broadcastWith() from YaraInstallRequested event.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL