types.go 1003 B

12345678910111213141516171819202122232425262728293031323334
  1. package event
  2. // EventType represents the type of event
  3. type EventType string
  4. const (
  5. // Processing status events
  6. EventTypeIndexScanning EventType = "index_scanning"
  7. EventTypeAutoCertProcessing EventType = "auto_cert_processing"
  8. EventTypeProcessingStatus EventType = "processing_status"
  9. // Nginx log status events (for backward compatibility)
  10. EventTypeNginxLogStatus EventType = "nginx_log_status"
  11. // Notification events
  12. EventTypeNotification EventType = "notification"
  13. )
  14. // Event represents a generic event structure
  15. type Event struct {
  16. Type EventType `json:"type"`
  17. Data interface{} `json:"data"`
  18. }
  19. // ProcessingStatusData represents the data for processing status events
  20. type ProcessingStatusData struct {
  21. IndexScanning bool `json:"index_scanning"`
  22. AutoCertProcessing bool `json:"auto_cert_processing"`
  23. }
  24. // NginxLogStatusData represents the data for nginx log status events (backward compatibility)
  25. type NginxLogStatusData struct {
  26. Scanning bool `json:"scanning"`
  27. }