Documentation ¶
Overview ¶
Package audit provides a definition of an audit event and an standard inteface to register events being triggered. Other packages may provide implementations of this interface to ship audit events to different destinations
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Auditor ¶
type Auditor interface { // Call at shutdown to cleanly close the audit destination io.Closer // Audit event // source indicates the area that the event was triggered by // eventType indicates the specific event that occured // identity specifies the identity of the user that triggered this event, typically this is <role>/<cn> // contextID specifies the request ContextID that the event was triggered in [this can be used for cross service correlation of logs] // raftIndex indicates the index# of the raft log in RAFT that the event occured in [if applicable] // message contains any additional information about this event that is eventType specific Audit( source string, eventType string, identity string, contextID string, raftIndex uint64, message string) }
Auditor defines an interface that can receive information about audit events
type Collector ¶
type Collector struct { Destination Auditor // contains filtered or unexported fields }
Collector is an Auditor that collects audit events in memory and sends them to the supplied destination Auditor when Submit is called. This can be useful for collecting up a set of audit events that aren't true until some later condition is verified [e.g. an Update to DB was successfull]
func (*Collector) Audit ¶
func (c *Collector) Audit(source string, eventType string, identity string, contextID string, raftIndex uint64, message string)
Audit records a new Auditable event, its kept in memory until Submit() is called at which point it is sent to the Destination auditor
type RaftIndexer ¶
type RaftIndexer interface { // SetRaftIndex allows the raft index to be potentially updated // it returns true if the index was succesfully updated, false if // not. [typically impls should only allow it be set if it wasn't // previously set] SetRaftIndex(i uint64) bool }
RaftIndexer identifies Event implementations that allow the raft index to be set