wellknown

package
v0.5.7 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2022 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Overview

Package wellknown provides an middleware that lets sites to register themselfs to wellknown uris

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Finger

type Finger struct {
	Webfinger Webfinger
	Protocol  string
}

Finger is an Simple Type for site to transport the information about the webfinger to the middleware

type FingerSite

type FingerSite interface {
	httpserver.Site
	RegisterFingers() []*Finger
}

FingerSite is an type of site that provide content and want to publish it with webfinger

type Link struct {
	Rel  string
	Type string
	Href *url.URL
}

Link is the reference where the application can find the object

type Middleware

type Middleware struct {
	// contains filtered or unexported fields
}

Middleware is an middleware for sites to register themselfs to provide wellknown urls

func New

func New() *Middleware

New creates a new initialized Middleware

func (*Middleware) Defaults

func (*Middleware) Defaults() middleware.Config

Defaults returns nothing

func (*Middleware) Gin

func (*Middleware) Gin(c *gin.Context)

Gin does nothing.

func (*Middleware) Init

func (m *Middleware) Init(rg *gin.RouterGroup)

Init initializes the routergroup. It must always run on /

func (*Middleware) PreSetup

func (m *Middleware) PreSetup(s []any) error

PreSetup goes through all sites and collects all registrations for wellknown uris

func (*Middleware) Setup

func (*Middleware) Setup(middleware.Config)

Setup does nothing

func (*Middleware) Teardown

func (*Middleware) Teardown()

Teardown does nothing

type Webfinger

type Webfinger func(resource string) ([]string, []*Link, bool)

Webfinger is an function that accepts the account part(after ?resource=<protocol>:) and returns the aliases and the links. The bool value if for faster detection if the account was found.

Jump to

Keyboard shortcuts

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