Drop WithCreatedAtTime, WithSinceTime, WithUntilTime; nil Tags on NewEvent
This commit is contained in:
+2
-10
@@ -3,9 +3,7 @@
|
||||
// serialization, cryptographic signatures, and subscription filters.
|
||||
package events
|
||||
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
|
||||
// Tag represents a single tag within an event as an array of strings.
|
||||
// The first element identifies the tag name, the second contains the value,
|
||||
@@ -26,7 +24,7 @@ type Event struct {
|
||||
}
|
||||
|
||||
func NewEvent(opts ...EventOption) Event {
|
||||
e := Event{Tags: make([]Tag, 0)}
|
||||
e := Event{}
|
||||
for _, opt := range opts {
|
||||
opt(&e)
|
||||
}
|
||||
@@ -53,12 +51,6 @@ func WithCreatedAt(t int64) EventOption {
|
||||
}
|
||||
}
|
||||
|
||||
func WithCreatedAtTime(t time.Time) EventOption {
|
||||
return func(e *Event) {
|
||||
e.CreatedAt = t.Unix()
|
||||
}
|
||||
}
|
||||
|
||||
func WithKind(k int) EventOption {
|
||||
return func(e *Event) {
|
||||
e.Kind = k
|
||||
|
||||
Reference in New Issue
Block a user