mirror of
https://github.com/mariocandela/beelzebub.git
synced 2025-07-01 18:47:26 -04:00
improve dateTime into event
This commit is contained in:
@ -2,6 +2,7 @@ package tracer
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Strategy func(event Event)
|
type Strategy func(event Event)
|
||||||
@ -17,10 +18,12 @@ func Init(strategy Strategy) *Tracer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (tracer *Tracer) TraceEvent(event Event) {
|
func (tracer *Tracer) TraceEvent(event Event) {
|
||||||
|
event.DateTime = time.Now().UTC().String()
|
||||||
tracer.strategy(event)
|
tracer.strategy(event)
|
||||||
}
|
}
|
||||||
|
|
||||||
type Event struct {
|
type Event struct {
|
||||||
|
DateTime string
|
||||||
RemoteAddr string
|
RemoteAddr string
|
||||||
Protocol string
|
Protocol string
|
||||||
Command string
|
Command string
|
||||||
|
Reference in New Issue
Block a user