content

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: 9 Imported by: 0

Documentation

Index

Constants

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

	// Expected number of Charset header components
	CharSetComponent int = 2
)

Variables

This section is empty.

Functions

This section is empty.

Types

type HTMLContent

type HTMLContent struct {
	ContentEncoding string
	URL             string
	// contains filtered or unexported fields
}

HTMLContent describe the html page of the URL.

func FetchHTMLContent

func FetchHTMLContent(c context.Context, url string) (*HTMLContent, error)

FetchHTMLContent fetch the url content, check and return HTMLContent instance.

func NewHTMLContent

func NewHTMLContent(url string) HTMLContent

NewHTMLContent return a new HTMLContent instance.

func (*HTMLContent) MetaAttrs

func (content *HTMLContent) MetaAttrs() map[string]string

MetaAttrs return the Meta attributes of the HTMLContent.

type MetaAttr

type MetaAttr struct {
	Name    string
	Content string
}

MetaAttr keeps a pair of name and content.

func (MetaAttr) IsValid

func (attr MetaAttr) IsValid() bool

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

func (MetaAttr) String

func (attr MetaAttr) String() string

String return a description about this instance.

Jump to

Keyboard shortcuts

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