favii

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: May 7, 2022 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

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 a http.Client for doing all HTTP Requests for fetching the HTML Pages.

func New

func New(useCache bool) *Favii

New creates a new Favii struct with http.DefaultClient and empty map, also an optional cache map.

func (*Favii) GetMetaInfo

func (f *Favii) GetMetaInfo(url string) (*MetaInfo, error)

GetMetaInfo for getting meta information, it is mainly a wrapper around unexported method getMetaInfo().

type Favvo

type Favvo struct {
	// contains filtered or unexported fields
}

func Setup

func Setup() *Favvo

func (*Favvo) UpdateSite

func (f *Favvo) UpdateSite(site Site) (Site, error)
type Link struct {
	Rel  string
	Href string
}

Link is a simple struct to keep rel and href attributes of an HTML Page mostly contains the details about link tag.

type Manifest

type Manifest struct {
	Name            string
	BackgroundColor string
	ThemeColor      string
	IconURL         string
}

Manifest contains data obtained from the manifest file if found on the site.

type Meta

type Meta struct {
	Name    string
	Content string
}

Meta is a simple struct to keep name and content attributes of an HTML Page mostly contains the details about meta tag.

type MetaInfo

type MetaInfo struct {
	URL             *url.URL
	Manifest        Link
	ThemeColor      string
	BackgroundColor string
	Metas           []Meta
	Links           []Link
}

MetaInfo with metadata details, this includes the URL used for requesting or calling GetMetaInfo() as well.

func (*MetaInfo) GetFaviconURL

func (m *MetaInfo) GetFaviconURL() string

GetFaviconURL for getting favicon URL from the MetaInfo, using link tags, or use default /favicon.ico.

func (*MetaInfo) GetManifest

func (m *MetaInfo) GetManifest() (Manifest, error)

GetManifest from the MetaInfo, using link tags.

type Site

type Site struct {
	Name            string
	URL             string
	Icon            string
	ThemeColor      string
	BackgroundColor string
}

Site is a simple wrapper around the meta information we can extract from a site.

Jump to

Keyboard shortcuts

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