resolver

package
v0.0.0-...-e0fb868 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// UserAgent is the user agent string used for all HTTP requests
	UserAgent    = "FediResolve/1.0 (https://github.com/melroy89/FediResolve)"
	AcceptHeader = "application/activity+json, application/ld+json"
)

Define common constants

Variables

This section is empty.

Functions

func ResolveInput

func ResolveInput(input string) (string, error)

ResolveInput is a convenience function that creates a new resolver and resolves the input

Types

type Resolver

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

Resolver handles the resolution of Fediverse URLs and handles

func NewResolver

func NewResolver() *Resolver

NewResolver creates a new Resolver instance

func (*Resolver) Resolve

func (r *Resolver) Resolve(input string) (string, error)

Resolve takes a URL or handle and resolves it to a formatted result

func (*Resolver) ResolveObjectOrNodeInfo

func (r *Resolver) ResolveObjectOrNodeInfo(objectURL string) ([]byte, error)

Try to extract actor, else try nodeinfo fallback for top-level domains

type WebFingerResponse

type WebFingerResponse struct {
	Subject string `json:"subject"`
	Links   []struct {
		Rel  string `json:"rel"`
		Type string `json:"type"`
		Href string `json:"href"`
	} `json:"links"`
}

WebFingerResponse represents the structure of a WebFinger response

Jump to

Keyboard shortcuts

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