event.go 457 B

123456789101112131415
  1. package events
  2. // Event marks items that can be sent as events.
  3. type Event interface{}
  4. // Sink accepts and sends events.
  5. type Sink interface {
  6. // Write an event to the Sink. If no error is returned, the caller will
  7. // assume that all events have been committed to the sink. If an error is
  8. // received, the caller may retry sending the event.
  9. Write(event Event) error
  10. // Close the sink, possibly waiting for pending events to flush.
  11. Close() error
  12. }