Add peer operation

This commit is contained in:
braginini
2022-12-07 11:06:46 +01:00
parent e75c25b10d
commit 04ea300043
6 changed files with 53 additions and 10 deletions

View File

@@ -9,9 +9,22 @@ const (
ManagementEvent Type = "management"
)
const (
AddPeerByUserOperation Operation = iota
AddPeerWithKeyOperation
)
const (
AddPeerByUserOperationMessage string = "Add new peer"
AddPeerWithKeyOperationMessage string = AddPeerByUserOperationMessage
)
// Type of the Event
type Type string
// Operation is an action that triggered an Event
type Operation int
// Store provides an interface to store or stream events.
type Store interface {
// Save an event in the store
@@ -28,6 +41,8 @@ type Event struct {
Timestamp time.Time
// Operation that was performed during the event
Operation string
// OperationCode that was performed during the event
OperationCode Operation
// ID of the event (can be empty, meaning that it wasn't yet generated)
ID uint64
// Type of the event