rip off go-nostr for filters and all necessaries

This commit is contained in:
2025-05-30 21:19:47 +01:00
parent d14da6788f
commit b383fadf47
15 changed files with 1374 additions and 12 deletions

17
timestamp/timestamp.go Normal file
View File

@@ -0,0 +1,17 @@
package timestamp
import (
"time"
"golang.org/x/exp/constraints"
)
type Timestamp int64
func Now() Timestamp { return Timestamp(time.Now().Unix()) }
func New[T constraints.Integer | constraints.Float](t T) Timestamp {
return Timestamp(t)
}
func (t Timestamp) Time() time.Time { return time.Unix(int64(t), 0) }