Documentation
¶
Index ¶
- func InputToEventPointer(input string) *pointers.EventPointer
- func InputToProfile(c context.T, input string) *pointers.ProfilePointer
- type Follow
- type ProfileMetadata
- type Reference
- type Relay
- type System
- func (sys *System) ExpandQueriesByAuthorAndRelays(c context.T, f filter.T) (map[*relays.Relay]filter.T, error)
- func (sys System) FetchOrStoreProfileMetadata(c context.T, pubkey string) ProfileMetadata
- func (sys System) FetchOutboxRelays(c context.T, pubkey string) []string
- func (sys System) FetchProfileMetadata(c context.T, pubkey string) ProfileMetadata
- func (sys System) FetchRelays(c context.T, pubkey string) []Relay
- func (sys System) FetchUserEvents(c context.T, filt filter.T) (map[string][]*event.T, error)
- func (sys System) StoreRelay() eventstore.RelayInterface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InputToEventPointer ¶
func InputToEventPointer(input string) *pointers.EventPointer
InputToEventPointer turns any note/nevent/hex input into a EventPointer (or nil).
func InputToProfile ¶
func InputToProfile(c context.T, input string) *pointers.ProfilePointer
InputToProfile turns any npub/nprofile/hex/nip05 input into a ProfilePointer (or nil).
Types ¶
type ProfileMetadata ¶
type ProfileMetadata struct {
PubKey string `json:"-"` // must always be set otherwise things will break
Event *event.T `json:"-"` // may be empty if a profile metadata event wasn't found
// 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 FetchProfileMetadata(c context.T, pool *pools.SimplePool, pubkey string, relays ...string) ProfileMetadata
func ParseMetadata ¶
func ParseMetadata(event *event.T) (meta ProfileMetadata, e 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.ProfilePointer
Event *pointers.EventPointer
Entity *pointers.EntityPointer
}
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 cache.Cache32[[]Relay]
FollowsCache cache.Cache32[[]Follow]
MetadataCache cache.Cache32[ProfileMetadata]
Pool *pools.SimplePool
RelayListRelays []string
FollowListRelays []string
MetadataRelays []string
Store eventstore.Store
}
func (*System) ExpandQueriesByAuthorAndRelays ¶
func (System) FetchOrStoreProfileMetadata ¶
func (sys 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 (sys 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 (sys System) StoreRelay() eventstore.RelayInterface
Source Files
¶
Click to show internal directories.
Click to hide internal directories.