webmention

package module
v0.0.0-...-baccd6f Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2023 License: MIT Imports: 8 Imported by: 0

README

go.mills.io/webmention

Build Status Go Report Card Go Reference

go.mills.io/webmention is a Go library that implements support for the IndieWeb WebMention protocol. Both client and server support are included.

Quick Start

TBD

License

go.mills.io/webmention is licensed under the terms of the MIT license

Documentation

Overview

Package webmention implements the IndieWeb WebMention protocol

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Callback

type Callback func(source, target *url.URL, sourceData *microformats.Data)

Callback is a function that is called on receipt of a processed incoming webmention Use this to perform function calls of inboudn webmentions. The source and target URL(s) as well as any discovered and parsed microformats data found on the source page are passed to the function.

type Link struct {
	URL    *url.URL
	Params map[string][]string
}

Link is a URL with one or more optional parameters for example: link: <https://twtxt.net/webmention>; rel="webmention"

func GetHeaderLinks(headers []string) []*Link

GetHeaderLinks parses a slice of `Link:` HTTP headers (without the "Link:" prefix) into a slice of `Link`(s) used for discovering the webmention endpoints of a target URL.

type WebMention

type WebMention interface {
	http.Handler
	Notify(target *url.URL, source *url.URL)
	SetCallback(fn Callback)
}

WebMention defines an interface for handling inbound and outbound webmentions which must implement the `http.Handler` interface and a few methods for sending outbound notifications to a webmention target and setting a callback function for received inbound webmentions from a source.

func New

func New() WebMention

New creates a new default WebMention processor for handling inbound and outbound webmentions

Jump to

Keyboard shortcuts

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