From c6ee93341c53962d9edd5578dacc5b2e2e7bf1db Mon Sep 17 00:00:00 2001 From: "Alex Ellis (VMware)" Date: Thu, 30 Aug 2018 09:48:14 +0100 Subject: [PATCH] Add AuditLogger interface Signed-off-by: Alex Ellis (VMware) --- sdk/interfaces.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 sdk/interfaces.go diff --git a/sdk/interfaces.go b/sdk/interfaces.go new file mode 100644 index 000000000..9dd249414 --- /dev/null +++ b/sdk/interfaces.go @@ -0,0 +1,20 @@ +package sdk + +type Audit interface { + Post(AuditEvent) error +} + +type NilLogger struct { +} + +func (l NilLogger) Post(auditEvent AuditEvent) error { + return nil +} + +type AuditLogger struct { +} + +func (l AuditLogger) Post(auditEvent AuditEvent) error { + PostAudit(auditEvent) + return nil +}