mirror of
https://github.com/netbirdio/netbird.git
synced 2026-05-02 07:06:41 +00:00
Rename audit to event
This commit is contained in:
@@ -1,32 +1,35 @@
|
|||||||
package audit
|
package event
|
||||||
|
|
||||||
import "time"
|
import "time"
|
||||||
|
|
||||||
const (
|
const (
|
||||||
// DeviceEvent describes an event that happened of a device (e.g, connected/disconnected)
|
// DeviceEvent describes an event that happened of a device (e.g, connected/disconnected)
|
||||||
DeviceEvent EventType = "device"
|
DeviceEvent Type = "device"
|
||||||
// ManagementEvent describes an event that happened on a Management service (e.g., user added)
|
// ManagementEvent describes an event that happened on a Management service (e.g., user added)
|
||||||
ManagementEvent EventType = "management"
|
ManagementEvent Type = "management"
|
||||||
)
|
)
|
||||||
|
|
||||||
type EventType string
|
type Type string
|
||||||
|
|
||||||
// EventSink provides an interface to store or stream events.
|
// Sink provides an interface to store or stream events.
|
||||||
type EventSink interface {
|
type Sink interface {
|
||||||
// Add an event to the sink.
|
// Add an event to the sink.
|
||||||
Add(event *Event) error
|
Add(event *Event) error
|
||||||
// Close the sink flushing events if necessary
|
// Close the sink flushing events if necessary
|
||||||
Close() error
|
Close() error
|
||||||
}
|
}
|
||||||
|
|
||||||
// Event represents a network activity.
|
// Event represents a network activity event.
|
||||||
type Event struct {
|
type Event struct {
|
||||||
// Timestamp of the event
|
// Timestamp of the event
|
||||||
Timestamp time.Time
|
Timestamp time.Time
|
||||||
// Message of the event
|
// Message of the event
|
||||||
Message string
|
Message string
|
||||||
// ID of the event (can be empty, meaning that it wasn't yet generated)
|
// ID of the event (can be empty, meaning that it wasn't yet generated)
|
||||||
ID string
|
ID uint64
|
||||||
// Type of the event
|
// Type of the event
|
||||||
Type EventType
|
Type Type
|
||||||
|
|
||||||
|
//
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package audit
|
package event
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"database/sql"
|
"database/sql"
|
||||||
Reference in New Issue
Block a user