handlers

package
v0.0.0-...-a196d40 Latest Latest
Warning

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

Go to latest
Published: May 6, 2023 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StandardMetaTags = iota
	WeChatMP
)

Variables

This section is empty.

Functions

This section is empty.

Types

type HTMLMetaAttr

type HTMLMetaAttr struct {
	Key   string
	Value string
}

type LinkPreviewContext

type LinkPreviewContext struct {
	TargetType  int    `json:"-"`
	Title       string `json:"title"`
	Description string `json:"description"`
	ImageURL    string `json:"image"`
	Link        string `json:"website"`

	Client *http.Request     `json:"-"`
	Parsed *goquery.Document `json:"-"`
}

func (*LinkPreviewContext) PreviewContext

func (p *LinkPreviewContext) PreviewContext() *LinkPreviewContext

type PreviewHandler

type PreviewHandler interface {
	PreviewContext() *LinkPreviewContext
	Preview() (*LinkPreviewContext, error)
}

func GetPreviewHandler

func GetPreviewHandler(c *LinkPreviewContext) (PreviewHandler, error)

type StandardLinkPreview

type StandardLinkPreview struct {
	*LinkPreviewContext
}

func (*StandardLinkPreview) Preview

func (p *StandardLinkPreview) Preview() (*LinkPreviewContext, error)

Jump to

Keyboard shortcuts

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