Documentation
¶
Index ¶
- func DetermineEventCategory(kind int) string
- func EnsureFileExists(filePath string, content []byte)
- func FetchPubkeysFromDomains(domains []string) ([]string, error)
- func GetClientIP(r *http.Request) string
- func LoadRelayMetadata(filename string) error
- func LoadRelayMetadataJSON() error
- func RelayInfoHandler(w http.ResponseWriter, r *http.Request)
- func SendToBackupRelay(backupURL string, evt nostr.Event) error
- func ToInt(i interface{}) *int
- func ToInt64(i interface{}) *int64
- func ToIntArray(i interface{}) []int
- func ToStringArray(i interface{}) []string
- func ToTagsMap(i interface{}) map[string][]string
- func ToTime(data interface{}) *time.Time
- type NostrJSON
- type RelayMetadata
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DetermineEventCategory ¶
func EnsureFileExists ¶
EnsureFileExists creates a file from embedded content if it doesn't exist
func FetchPubkeysFromDomains ¶
FetchPubkeysFromDomains fetches nostr.json pubkeys from multiple domains This function is called by the pubkey cache system and doesn't maintain its own cache
func GetClientIP ¶
func LoadRelayMetadata ¶
func LoadRelayMetadataJSON ¶
func LoadRelayMetadataJSON() error
func RelayInfoHandler ¶
func RelayInfoHandler(w http.ResponseWriter, r *http.Request)
func ToIntArray ¶
func ToIntArray(i interface{}) []int
func ToStringArray ¶
func ToStringArray(i interface{}) []string
Types ¶
type RelayMetadata ¶
type RelayMetadata struct {
Name string `json:"name"`
Description string `json:"description"`
Banner string `json:"banner"`
Icon string `json:"icon"`
Pubkey string `json:"pubkey"`
Contact string `json:"contact"`
SupportedNIPs []int `json:"supported_nips"`
Software string `json:"software"`
Version string `json:"version"`
PrivacyPolicy string `json:"privacy_policy"`
TermsOfService string `json:"terms_of_service"`
Limitation struct {
MaxMessageLength int `json:"max_message_length"`
MaxContentLength int `json:"max_content_length"`
MaxSubscriptions int `json:"max_subscriptions"`
MaxLimit int `json:"max_limit"`
AuthRequired bool `json:"auth_required"`
PaymentRequired bool `json:"payment_required"`
RestrictedWrites bool `json:"restricted_writes"`
CreatedAtLowerLimit *int64 `json:"created_at_lower_limit"`
CreatedAtUpperLimit *int64 `json:"created_at_upper_limit"`
} `json:"limitation"`
RelayCountries []string `json:"relay_countries"`
LanguageTags []string `json:"language_tags"`
Tags []string `json:"tags"`
PostingPolicy string `json:"posting_policy"`
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.