Documentation ¶
Index ¶
- type Event
- func (e *Event) Difficulty() int
- func (e *Event) Encode() ([]byte, error)
- func (e *Event) GetRawID() [32]byte
- func (e *Event) IsProtected() bool
- func (e *Event) IsValid(id [32]byte) bool
- func (e Event) MarshalEasyJSON(w *jwriter.Writer)
- func (e Event) MarshalJSON() ([]byte, error)
- func (e *Event) Serialize() []byte
- func (e *Event) String() string
- func (e *Event) UnmarshalEasyJSON(l *jlexer.Lexer)
- func (e *Event) UnmarshalJSON(data []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Event ¶
type Event struct { ID string `bson:"id" json:"id"` PublicKey string `bson:"pubkey" json:"pubkey"` CreatedAt int64 `bson:"created_at" json:"created_at"` Kind types.Kind `bson:"kind" json:"kind"` Tags types.Tags `bson:"tags" json:"tags"` Content string `bson:"content" json:"content"` Signature string `bson:"sig" json:"sig"` }
Event represents an event structure defined on NIP-01.
func (*Event) Difficulty ¶ added in v0.0.5
Difficulty returns the leading zeros of event id in base-2.
func (*Event) IsProtected ¶ added in v0.0.5
IsProtected checks is ["-"] is present, look nip-70 for more.
func (Event) MarshalEasyJSON ¶
MarshalEasyJSON supports easyjson.Marshaler interface.
func (Event) MarshalJSON ¶
MarshalJSON supports json.Marshaler interface.
func (*Event) UnmarshalEasyJSON ¶
UnmarshalEasyJSON supports easyjson.Unmarshaler interface.
func (*Event) UnmarshalJSON ¶
UnmarshalJSON supports json.Unmarshaler interface.
Click to show internal directories.
Click to hide internal directories.