github.com/hernad/nomad@v1.6.112/command/agent/event/event.go (about) 1 // Copyright (c) HashiCorp, Inc. 2 // SPDX-License-Identifier: MPL-2.0 3 4 package event 5 6 import ( 7 "context" 8 ) 9 10 // Auditor describes the interface that must be implemented by an eventer. 11 type Auditor interface { 12 // Event emits an event to the auditor. 13 Event(ctx context.Context, eventType string, payload interface{}) error 14 15 // Enabled details if the auditor is enabled or not. 16 Enabled() bool 17 18 // Reopen signals to auditor to reopen any files they have open. 19 Reopen() error 20 21 // SetEnabled sets the auditor to enabled or disabled. 22 SetEnabled(enabled bool) 23 24 // DeliveryEnforced returns whether or not delivery of an audit 25 // log must be enforced 26 DeliveryEnforced() bool 27 }