Documentation
¶
Index ¶
- type MentionStore
- func (ms *MentionStore) GetVerifiedMentions(slug string) []Webmention
- func (ms *MentionStore) HandleWebmention(w http.ResponseWriter, r *http.Request)
- func (ms *MentionStore) LoadMentions(slug string) []Webmention
- func (ms *MentionStore) SaveMention(slug string, mention Webmention) error
- func (ms *MentionStore) SendMentions(sourceURL, htmlContent string) []SendResult
- type SendResult
- type Webmention
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MentionStore ¶
type MentionStore struct {
// contains filtered or unexported fields
}
MentionStore manages webmention storage on disk
func NewMentionStore ¶
func NewMentionStore(dataDir string) *MentionStore
NewMentionStore creates a new MentionStore
func (*MentionStore) GetVerifiedMentions ¶
func (ms *MentionStore) GetVerifiedMentions(slug string) []Webmention
GetVerifiedMentions returns only verified mentions for a slug
func (*MentionStore) HandleWebmention ¶
func (ms *MentionStore) HandleWebmention(w http.ResponseWriter, r *http.Request)
HandleWebmention handles POST /webmention
func (*MentionStore) LoadMentions ¶
func (ms *MentionStore) LoadMentions(slug string) []Webmention
LoadMentions loads all mentions for a slug
func (*MentionStore) SaveMention ¶
func (ms *MentionStore) SaveMention(slug string, mention Webmention) error
SaveMention adds or updates a mention for a slug (deduplicates by source+target)
func (*MentionStore) SendMentions ¶
func (ms *MentionStore) SendMentions(sourceURL, htmlContent string) []SendResult
SendMentions extracts external links from HTML and sends webmentions to any that support them
type SendResult ¶
type SendResult struct {
Target string `json:"target"`
Endpoint string `json:"endpoint"`
Success bool `json:"success"`
Error string `json:"error,omitempty"`
}
SendResult represents the outcome of sending a webmention to one target
type Webmention ¶
type Webmention struct {
Source string `json:"source"`
Target string `json:"target"`
Verified bool `json:"verified"`
VerifiedAt time.Time `json:"verified_at,omitempty"`
ReceivedAt time.Time `json:"received_at"`
AuthorName string `json:"author_name,omitempty"`
AuthorURL string `json:"author_url,omitempty"`
Content string `json:"content,omitempty"`
MentionType string `json:"mention_type,omitempty"` // "reply", "like", "repost", "mention"
}
Webmention represents a received or sent webmention
Click to show internal directories.
Click to hide internal directories.