17 lines
358 B
Go
17 lines
358 B
Go
package journal
|
|
|
|
type nilJournal struct{}
|
|
|
|
// nilj is a singleton nil journal.
|
|
var nilj Journal = &nilJournal{}
|
|
|
|
func NilJournal() Journal {
|
|
return nilj
|
|
}
|
|
|
|
func (n *nilJournal) RegisterEventType(_, _ string) EventType { return EventType{} }
|
|
|
|
func (n *nilJournal) RecordEvent(_ EventType, _ interface{}) {}
|
|
|
|
func (n *nilJournal) Close() error { return nil }
|