Documentation
¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Link ¶
type Link struct {
URL string `json:"url,omitempty"`
Location string `json:"location,omitempty"`
Canonical string `json:"canonical,omitempty"`
Title string `json:"title,omitempty"`
Description string `json:"description,omitempty"`
}
Link stores metadata of a URL.
func New ¶
New fetches URL metadata and returns a Link instance.
Example ¶
link, err := New(context.Background(), "https://git.io/vFR5M", "")
if err != nil {
fmt.Println(err)
return
}
fmt.Println(link.Encode(StyleMarkdown))
func (*Link) CanonicalURL ¶
CanonicalURL returns the canonical URL when available.
Click to show internal directories.
Click to hide internal directories.