url

package
v0.0.0-...-d3fec07 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2026 License: AGPL-3.0 Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package url provides the /api/url endpoint for URL preview.

Index

Constants

View Source
const MaxPreviewURLBytes = 4096

MaxPreviewURLBytes is the longest `url` the preview endpoint accepts.

ブラウザが扱う URL の上限 (概ね 2KiB〜8KiB) に収まり、抽出した URL を切る 2048 バイト (parser) より少し広い。LRU の 1 件あたりの上限でもある。

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

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

Handler handles the URL preview endpoint.

func NewHandler

func NewHandler(fetcher *urlpreview.Fetcher, entityPacker *entity.Packer) *Handler

NewHandler creates a new URL preview handler. entityPacker is the Packer this Handler packs entities with (#3798); 無いとプレビューの画像の URL を media proxy に通さずに返すので、構築子の必須の引数で受ける (#3823)。

func (*Handler) Preview

func (h *Handler) Preview(c *echo.Context) error

Preview handles GET /url (matches Misskey's endpoint path). フロントエンドがリンクプレビューカード表示のために呼ぶ。

Jump to

Keyboard shortcuts

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