You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
786 B

2 years ago
  1. package events
  2. import (
  3. "fmt"
  4. lucifer3 "git.aiterp.net/lucifer3/server"
  5. "github.com/google/uuid"
  6. )
  7. type AssignmentCreated struct {
  8. ID uuid.UUID
  9. Match string
  10. Effect lucifer3.Effect
  11. }
  12. func (e AssignmentCreated) EventDescription() string {
  13. return fmt.Sprintf("AssignmentCreated(id=%s, match=%s, effect=%s)", e.ID, e.Match, e.Effect.EffectDescription())
  14. }
  15. type AssignmentRemoved struct {
  16. ID uuid.UUID
  17. }
  18. func (e AssignmentRemoved) EventDescription() string {
  19. return fmt.Sprintf("AssignmentRemoved(id=%s)", e.ID)
  20. }
  21. type DeviceAssigned struct {
  22. DeviceID string `json:"deviceId"`
  23. AssignmentID *uuid.UUID `json:"assignmentId"`
  24. }
  25. func (e DeviceAssigned) EventDescription() string {
  26. return fmt.Sprintf("DeviceAssigned(device=%s, %s)", e.DeviceID, e.AssignmentID)
  27. }