Documentation ¶
Index ¶
- func Hash(in []byte) (out []byte)
- type Ascending
- type B
- type C
- type Ctx
- type Descending
- type E
- type N
- type S
- type T
- func (ev *T) CheckSignature() (valid bool, err error)deprecated
- func (ev *T) ContentString() (s S)
- func (ev *T) EventID() (eid *eventid.T)
- func (ev *T) GetIDBytes() []byte
- func (ev *T) IDString() (s S)
- func (ev *T) MarshalJSON(dst B) (b B, err error)
- func (ev *T) PubKeyString() (s S)
- func (ev *T) Serialize() (b B)
- func (ev *T) SigString() (s S)
- func (ev *T) Sign(keys signer.I) (err error)
- func (ev *T) SignWithSecKey(sk *k1.SecretKey, so ...sch.SignOption) (err error)deprecated
- func (ev *T) TagStrings() (s [][]S)
- func (ev *T) ToCanonical() (b B)
- func (ev *T) UnmarshalJSON(b B) (r B, err error)
- func (ev *T) Verify() (valid bool, err error)
- type Ts
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Ascending ¶
type Ascending []*T
Ascending is a slice of events that sorts in ascending chronological order
type Descending ¶
type Descending []*T
Descending sorts a slice of events in reverse chronological order (newest first)
func (Descending) Len ¶
func (e Descending) Len() int
func (Descending) Less ¶
func (e Descending) Less(i, j int) bool
func (Descending) Swap ¶
func (e Descending) Swap(i, j int)
type T ¶
type T struct { // ID is the SHA256 hash of the canonical encoding of the event in binary format ID B // PubKey is the public key of the event creator in binary format PubKey B // CreatedAt is the UNIX timestamp of the event according to the event // creator (never trust a timestamp!) CreatedAt *timestamp.T // Kind is the nostr protocol code for the type of event. See kind.T Kind *kind.T // Tags are a list of tags, which are a list of strings usually structured // as a 3 layer scheme indicating specific features of an event. Tags *tags.T // Content is an arbitrary string that can contain anything, but usually // conforming to a specification relating to the Kind and the Tags. Content B // Sig is the signature on the ID hash that validates as coming from the // Pubkey in binary format. Sig B }
T is the primary datatype of nostr. This is the form of the structure that defines its JSON string based format.
func (*T) CheckSignature
deprecated
func (*T) ContentString ¶
func (*T) GetIDBytes ¶
GetIDBytes returns the raw SHA256 hash of the canonical form of an T.
func (*T) PubKeyString ¶
func (*T) Sign ¶
Sign the event using the signer.I. Uses github.com/bitcoin-core/secp256k1 if available for much faster signatures.
func (*T) SignWithSecKey
deprecated
func (*T) TagStrings ¶
func (*T) ToCanonical ¶
Click to show internal directories.
Click to hide internal directories.