Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func VerifyEvent ¶
func VerifyEventID ¶
func VerifySignature ¶
Types ¶
type Event ¶
type Event struct { ID ID `json:"id" bson:"id"` PubKey PubKey `json:"pubkey" bson:"pubkey"` CreatedAt Timestamp `json:"created_at" bson:"created_at"` Kind Kind `json:"kind" bson:"kind"` Tags []Tag `json:"tags" bson:"tags"` Content string `json:"content" bson:"content"` Sig Signature `json:"sig" bson:"sig"` }
func UnStructure ¶
func UnStructure(e StructuredEvent) Event
type ID ¶
type ID string // <32-bytes lowercase hex-encoded sha256 of the the serialized event data>
func NewEventID ¶
type PubKey ¶
type PubKey string // <32-bytes lowercase hex-encoded public key of the event creator>
func (PubKey) BIP340Secp256k1 ¶
type Signature ¶
type Signature string // <64-bytes hex of the signature of the sha256 hash of the serialized event data, which is the same as the "id" field>
func (Signature) BIP340Secp256k1 ¶
type StructuredEvent ¶
type StructuredEvent struct { Event Event `bson:"event"` E []ID `bson:"#e"` P []PubKey `bson:"#p"` }
func Structure ¶
func Structure(e Event) StructuredEvent
func (StructuredEvent) UniqueMatch ¶ added in v0.1.6
func (e StructuredEvent) UniqueMatch() primitive.M
Click to show internal directories.
Click to hide internal directories.