sitemeta

package
v0.0.0-...-ea72793 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultEncoding describe a default encoding.
	DefaultEncoding string = "UTF-8"
)

Variables

View Source
var CantParseErr error = errors.New("this site can't parse SiteMeta")

nolint

Functions

This section is empty.

Types

type SiteMeta

type SiteMeta struct {
	Attrs map[string]string
}

SiteMeta describe meta data of the website, like ogp, TwitterCard.

func Parse

func Parse(c context.Context, url string) (*SiteMeta, error)

Parse return SiteMeta instance if the url content has meta tags about twitter card or ogp.

func (*SiteMeta) AddMeta

func (meta *SiteMeta) AddMeta(key string, val string) bool

func (*SiteMeta) IsEmpty

func (meta *SiteMeta) IsEmpty() bool

func (*SiteMeta) IsValid

func (meta *SiteMeta) IsValid() bool

IsValid validate that this instance keeps valid value, or not.

func (*SiteMeta) String

func (meta *SiteMeta) String() string

String return a description about this instance.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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