2020-03-22 16:17:33 +00:00
|
|
|
package event
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
)
|
|
|
|
|
2020-03-23 23:32:58 +00:00
|
|
|
// Auditor describes the interface that must be implemented by an eventer.
|
|
|
|
type Auditor interface {
|
|
|
|
// Emit an event to the auditor
|
2020-03-22 16:17:33 +00:00
|
|
|
Event(ctx context.Context, eventType string, payload interface{}) error
|
2020-03-23 23:32:58 +00:00
|
|
|
|
|
|
|
// Specifies if the auditor is enabled or not
|
2020-03-22 16:17:33 +00:00
|
|
|
Enabled() bool
|
|
|
|
|
2020-03-23 23:32:58 +00:00
|
|
|
// Reopen signals to auditor to reopen any files they have open.
|
2020-03-22 16:17:33 +00:00
|
|
|
Reopen() error
|
|
|
|
|
2020-03-23 23:32:58 +00:00
|
|
|
// SetEnabled sets the auditor to enabled or disabled.
|
2020-03-22 16:17:33 +00:00
|
|
|
SetEnabled(enabled bool)
|
2020-03-23 23:32:58 +00:00
|
|
|
|
|
|
|
// DeliveryEnforced returns whether or not delivery of an audit
|
|
|
|
// log must be enforced
|
|
|
|
DeliveryEnforced() bool
|
2020-03-22 16:17:33 +00:00
|
|
|
}
|