Documentation ¶
Index ¶
- Constants
- type Event
- func (v Event) MarshalEasyJSON(w *jwriter.Writer)
- func (v Event) MarshalJSON() ([]byte, error)
- func (e Event) Serialize() []byte
- func (e *Event) Sign(privateKey string, signOpts ...schnorr.SignOption) error
- func (e Event) String() string
- func (v *Event) UnmarshalEasyJSON(l *jlexer.Lexer)
- func (v *Event) UnmarshalJSON(data []byte) error
- func (e Event) Validate() error
- func (e Event) ValidateSignature() (bool, error)
- type Eventer
- type Tag
- type Tags
- type Timestamp
Constants ¶
View Source
const ( KindProfileMetadata int = 0 KindTextNote int = 1 KindRecommendServer int = 2 KindContactList int = 3 KindEncryptedDirectMessage int = 4 KindDeletion int = 5 KindRepost int = 6 KindReaction int = 7 KindSimpleGroupChatMessage int = 9 KindSimpleGroupThread int = 11 KindSimpleGroupReply int = 12 KindChannelCreation int = 40 KindChannelMetadata int = 41 KindChannelMessage int = 42 KindChannelHideMessage int = 43 KindChannelMuteUser int = 44 KindPatch int = 1617 KindFileMetadata int = 1063 KindSimpleGroupAddUser int = 9000 KindSimpleGroupRemoveUser int = 9001 KindSimpleGroupEditMetadata int = 9002 KindSimpleGroupAddPermission int = 9003 KindSimpleGroupRemovePermission int = 9004 KindSimpleGroupDeleteEvent int = 9005 KindSimpleGroupEditGroupStatus int = 9006 KindSimpleGroupJoinRequest int = 9021 KindZapRequest int = 9734 KindZap int = 9735 KindMuteList int = 10000 KindPinList int = 10001 KindRelayListMetadata int = 10002 KindNWCWalletInfo int = 13194 KindClientAuthentication int = 22242 KindNWCWalletRequest int = 23194 KindNWCWalletResponse int = 23195 KindNostrConnect int = 24133 KindCategorizedPeopleList int = 30000 KindCategorizedBookmarksList int = 30001 KindProfileBadges int = 30008 KindBadgeDefinition int = 30009 KindStallDefinition int = 30017 KindProductDefinition int = 30018 KindArticle int = 30023 KindApplicationSpecificData int = 30078 KindRepositoryAnnouncement int = 30617 KindSimpleGroupMetadata int = 39000 KindSimpleGroupAdmins int = 39001 KindSimpleGroupMembers int = 39002 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Event ¶
type Event struct { Kind int `json:"kind"` Content string `json:"content"` Tags Tags `json:"tags"` CreatedAt Timestamp `json:"created_at"` ID *string `json:"id"` // set by Sign() Pubkey *string `json:"pubkey"` // set by Sign() Sig *string `json:"sig"` // set by Sign() }
func (Event) MarshalEasyJSON ¶
MarshalEasyJSON supports easyjson.Marshaler interface
func (Event) MarshalJSON ¶
MarshalJSON supports json.Marshaler interface
func (*Event) Sign ¶
func (e *Event) Sign(privateKey string, signOpts ...schnorr.SignOption) error
Sign signs an event with the given privateKey
func (*Event) UnmarshalEasyJSON ¶
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Event) UnmarshalJSON ¶
UnmarshalJSON supports json.Unmarshaler interface
func (Event) ValidateSignature ¶
ValidateSignature checks if the signature is valid for the id.
Click to show internal directories.
Click to hide internal directories.