webmention

package
v0.11.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 8, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL