urls

package
v0.63.5 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2020 License: MPL-2.0, MPL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const YouTubeOembedLink = "https://www.youtube.com/oembed?format=json&url=%s"

Variables

This section is empty.

Functions

func GetURLContent

func GetURLContent(url string) (data []byte, err error)

Types

type LinkPreviewData

type LinkPreviewData struct {
	Site         string `json:"site"`
	Title        string `json:"title"`
	ThumbnailURL string `json:"thumbnailUrl"`
}

func GetLinkPreviewData

func GetLinkPreviewData(link string) (previewData LinkPreviewData, err error)

func GetYoutubePreviewData

func GetYoutubePreviewData(link string) (previewData LinkPreviewData, err error)

type OembedData

type OembedData struct {
	ProviderName string `json:"provider_name"`
	Title        string `json:"title"`
	ThumbnailURL string `json:"thumbnail_url"`
}

func GetYoutubeOembed

func GetYoutubeOembed(url string) (data OembedData, err error)

type Site

type Site struct {
	Title   string `json:"title"`
	Address string `json:"address"`
}

func LinkPreviewWhitelist

func LinkPreviewWhitelist() []Site

Jump to

Keyboard shortcuts

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