Documentation ¶
Index ¶
- Constants
- func DecodeDataURL(data string) ([]byte, error)
- func EncodeDataURL(data []byte) (string, error)
- func GetGiphyLongURL(shortURL string) (longURL string, err error)
- func GetOembed(name, endpoint, url string, data interface{}) error
- type GiphyOembedData
- type LinkPreviewData
- func FakeGenericImageLinkPreviewData(title string, link string) (previewData LinkPreviewData, err error)
- func GetGenericLinkPreviewData(link string) (previewData LinkPreviewData, err error)
- func GetGiphyPreviewData(link string) (previewData LinkPreviewData, err error)
- func GetGiphyShortURLPreviewData(shortURL string) (data LinkPreviewData, err error)
- func GetLinkPreviewData(link string) (previewData LinkPreviewData, err error)
- func GetTwitterPreviewData(link string) (previewData LinkPreviewData, err error)
- func GetYoutubePreviewData(link string) (previewData LinkPreviewData, err error)
- type Site
- type TwitterOembedData
- type YoutubeOembedData
Constants ¶
View Source
const ( YoutubeOembedLink = "https://www.youtube.com/oembed?format=json&url=%s" TwitterOembedLink = "https://publish.twitter.com/oembed?url=%s" GiphyOembedLink = "https://giphy.com/services/oembed?url=%s" )
Variables ¶
This section is empty.
Functions ¶
func DecodeDataURL ¶ added in v0.161.2
func EncodeDataURL ¶ added in v0.161.2
func GetGiphyLongURL ¶ added in v0.70.0
GetGiphyLongURL Giphy has a shortener service called gph.is, the oembed service doesn't work with shortened urls, so we need to fetch the long url first
Types ¶
type GiphyOembedData ¶ added in v0.70.0
type LinkPreviewData ¶
type LinkPreviewData struct { Site string `json:"site" meta:"og:site_name"` Title string `json:"title" meta:"og:title"` ThumbnailURL string `json:"thumbnailUrl" meta:"og:image"` ContentType string `json:"contentType"` Height int `json:"height"` Width int `json:"width"` }
func FakeGenericImageLinkPreviewData ¶ added in v0.109.4
func FakeGenericImageLinkPreviewData(title string, link string) (previewData LinkPreviewData, err error)
func GetGenericLinkPreviewData ¶ added in v0.71.1
func GetGenericLinkPreviewData(link string) (previewData LinkPreviewData, err error)
func GetGiphyPreviewData ¶ added in v0.70.0
func GetGiphyPreviewData(link string) (previewData LinkPreviewData, err error)
func GetGiphyShortURLPreviewData ¶ added in v0.70.0
func GetGiphyShortURLPreviewData(shortURL string) (data LinkPreviewData, err error)
func GetLinkPreviewData ¶
func GetLinkPreviewData(link string) (previewData LinkPreviewData, err error)
func GetTwitterPreviewData ¶ added in v0.83.10
func GetTwitterPreviewData(link string) (previewData LinkPreviewData, err error)
func GetYoutubePreviewData ¶
func GetYoutubePreviewData(link string) (previewData LinkPreviewData, err error)
type Site ¶
type Site struct { Title string `json:"title"` Address string `json:"address"` ImageSite bool `json:"imageSite"` }
func LinkPreviewWhitelist ¶
func LinkPreviewWhitelist() []Site
type TwitterOembedData ¶ added in v0.83.10
type YoutubeOembedData ¶ added in v0.70.0
Click to show internal directories.
Click to hide internal directories.