Documentation ¶
Index ¶
Constants ¶
View Source
const (
DefaultRequestTimeout = 15000 * time.Millisecond
)
Variables ¶
This section is empty.
Functions ¶
func IsSupportedImageURL ¶
IsSupportedImageURL detects whether a URL ends with one of the supported image extensions. It provides a quick way to identify whether URLs should be unfurled as images without needing to retrieve the full response body first.
Types ¶
type ImageUnfurler ¶
type ImageUnfurler struct {
// contains filtered or unexported fields
}
func NewImageUnfurler ¶
func (*ImageUnfurler) Unfurl ¶
func (u *ImageUnfurler) Unfurl() (common.LinkPreview, error)
type OEmbedResponse ¶
type OEmbedUnfurler ¶
type OEmbedUnfurler struct {
// contains filtered or unexported fields
}
func NewOEmbedUnfurler ¶
func (OEmbedUnfurler) Unfurl ¶
func (u OEmbedUnfurler) Unfurl() (common.LinkPreview, error)
type OpenGraphMetadata ¶
type OpenGraphUnfurler ¶
type OpenGraphUnfurler struct {
// contains filtered or unexported fields
}
OpenGraphUnfurler should be preferred over OEmbedUnfurler because oEmbed gives back a JSON response with a "html" field that's supposed to be embedded in an iframe (hardly useful for existing Status' clients).
func NewOpenGraphUnfurler ¶
func (*OpenGraphUnfurler) Unfurl ¶
func (u *OpenGraphUnfurler) Unfurl() (common.LinkPreview, error)
type Unfurler ¶
type Unfurler interface {
Unfurl() (common.LinkPreview, error)
}
Click to show internal directories.
Click to hide internal directories.