handlers

package
Version: v0.0.0-...-4d94cb3 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2019 License: BSD-3-Clause Imports: 6 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
t or T : Toggle theme light dark auto
y or Y : Canonical URL