linkmeta

package
v0.31.0 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInternalIP = errors.New("internal IP addresses are not allowed")

ErrInternalIP indicates that a link preview target resolves to a disallowed internal address.

Functions

This section is empty.

Types

type HTMLMeta

type HTMLMeta struct {
	Title       string `json:"title"`
	Description string `json:"description"`
	Image       string `json:"image"`
}

HTMLMeta contains metadata used to build a link preview.

type HTMLMetaFetcher

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

HTMLMetaFetcher fetches and caches standards-based link preview metadata.

func NewHTMLMetaFetcher

func NewHTMLMetaFetcher() *HTMLMetaFetcher

NewHTMLMetaFetcher creates a link preview fetcher with an SSRF-safe HTTP client.

func (*HTMLMetaFetcher) Get

func (f *HTMLMetaFetcher) Get(ctx context.Context, urlStr string) (*HTMLMeta, error)

Get fetches metadata for a URL.

Jump to

Keyboard shortcuts

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