Documentation ¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Favii ¶
type Favii struct {
// contains filtered or unexported fields
}
Favii is basically a client to use the struct. It has an http.Client for doing all HTTP Requests for fetching the HTML Pages
Example ¶
ExampleFavii shows how to get the MetaInfo from an URL and also from that MetaInfo get favicon URL from that.
f := New(true) metainfo, err := f.GetMetaInfo("https://git.dcpri.me/modules/favii") if err != nil { log.Fatal(err) } fmt.Println(metainfo.GetFaviconURL())
Output: https://git.dcpri.me/assets/img/logo.svg
func New ¶
New creates a new Favii struct with http.DefaultClient and empty map, also an optional cache map
func NewWithClient ¶
NewWithClient creates a new Favii struct with provided http.Client and all other things similar to New()
type Link ¶
Link is a simple struct to keep rel and href attributes of an HTML Page mostly contains the details about link tag
type Meta ¶
Meta is a simple struct to keep name and content attributes of an HTML Page mostly contains the details about meta tag
type MetaInfo ¶
MetaInfo with metadata details, this includes the URL used for requesting or calling GetMetaInfo() as well.
func (*MetaInfo) GetFaviconURL ¶
GetFaviconURL for getting favicon URL from the MetaInfo, using link tags, or use default /favicon.ico.