Documentation ¶
Index ¶
- func InputToEventPointer(input string) (ep *pointers.Event)
- func InputToProfile(c context.T, input string) (pp *pointers.Profile)
- func IsValidRelayURL(u string) bool
- type Follow
- type ProfileMetadata
- type Reference
- type Relay
- type System
- func (s *System) ExpandQueriesByAuthorAndRelays(c context.T, f *filter.T) (filters map[*client.T]*filter.T, err error)
- func (s *System) FetchOrStoreProfileMetadata(c context.T, pubkey string) *ProfileMetadata
- func (s *System) FetchOutboxRelays(c context.T, pubkey string) []string
- func (s *System) FetchProfileMetadata(c context.T, pubkey string) *ProfileMetadata
- func (s *System) FetchRelays(c context.T, pubkey string) []Relay
- func (s *System) FetchUserEvents(c context.T, f *filter.T) (r map[string][]*event.T, err error)
- func (s *System) StoreRelay() eventstore.RelayInterface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InputToEventPointer ¶
InputToEventPointer turns any note/nevent/hex input into a EventPointer (or nil).
func InputToProfile ¶
InputToProfile turns any npub/nprofile/hex/nip5 input into a ProfilePointer (or nil).
func IsValidRelayURL ¶
Types ¶
type ProfileMetadata ¶
type ProfileMetadata struct { // PubKey must always be set otherwise things will break PubKey string `json:"-"` // Event may be empty if a profile metadata event wasn't found Event *event.T `json:"-,omitempty"` // every one of these may be empty Name string `json:"name,omitempty"` DisplayName string `json:"display_name,omitempty"` About string `json:"about,omitempty"` Website string `json:"website,omitempty"` Picture string `json:"picture,omitempty"` Banner string `json:"banner,omitempty"` NIP05 string `json:"nip05,omitempty"` LUD16 string `json:"lud16,omitempty"` }
func FetchProfileMetadata ¶
func ParseMetadata ¶
func ParseMetadata(ev *event.T) (pm *ProfileMetadata, err error)
func (ProfileMetadata) Npub ¶
func (p ProfileMetadata) Npub() string
func (ProfileMetadata) ShortName ¶
func (p ProfileMetadata) ShortName() string
type Reference ¶
type Reference struct { Text string Start int End int Profile *pointers.Profile Event *pointers.Event Entity *pointers.Entity }
func ParseReferences ¶
ParseReferences parses both NIP-08 and NIP-27 references in a single unifying interface.
type Relay ¶
func FetchRelaysForPubkey ¶
func ParseRelaysFromKind3 ¶
type System ¶
type System struct { RelaysCache cache32.I[[]Relay] FollowsCache cache32.I[[]Follow] MetadataCache cache32.I[*ProfileMetadata] Pool *pool.Simple RelayListRelays []string FollowListRelays []string MetadataRelays []string Store eventstore.Store }
func (*System) ExpandQueriesByAuthorAndRelays ¶
func (*System) FetchOrStoreProfileMetadata ¶
func (s *System) FetchOrStoreProfileMetadata(c context.T, pubkey string) *ProfileMetadata
FetchOrStoreProfileMetadata is like FetchProfileMetadata, but also saves the result to the sys.Store
func (*System) FetchOutboxRelays ¶
func (*System) FetchProfileMetadata ¶
func (s *System) FetchProfileMetadata(c context.T, pubkey string) *ProfileMetadata
FetchProfileMetadata fetches metadata for a given user from the local cache, or from the local store, or, failing these, from the target user's defined outbox relays -- then caches the result.
func (*System) FetchUserEvents ¶
FetchUserEvents fetches events from each users' outbox relays, grouping queries when possible.
func (*System) StoreRelay ¶
func (s *System) StoreRelay() eventstore.RelayInterface
Source Files ¶
Click to show internal directories.
Click to hide internal directories.