net

package
v1.16.1 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2021 License: OSL-3.0 Imports: 13 Imported by: 0

Documentation

Overview

HTML and HTTP parsers.

Why use "github.com/tdewolff/parse/v2/html" instead of "golang.org/x/net/html"?

"go.sum" with "golang.org/x/net/html" looks like this:

golang.org/x/net v0.0.0-20210924151903
golang.org/x/sys v0.0.0-20201119102817
golang.org/x/sys v0.0.0-20210423082822
golang.org/x/term v0.0.0-20201126162022
golang.org/x/text v0.3.6
golang.org/x/tools v0.0.0-20180917221912

"go.sum" with "github.com/tdewolff/parse/v2/html" looks like this:

github.com/tdewolff/parse/v2 v2.5.21
github.com/tdewolff/test v1.0.6

also, if you count lines of code in non test Go files, including imported packages, "golang.org/x/net/html" has 8,149, while "github.com/tdewolff/parse/v2/html" has 1,718.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadRequest

func ReadRequest(src io.Reader) (*http.Request, error)

Types

type Node

type Node struct {
	Attr map[string]string
	Data Text
}

func ReadHTML

func ReadHTML(src io.Reader, tag string) []Node

type Progress added in v1.16.1

type Progress struct {
	*http.Response
	Content, PartLength int64
	time.Time
	// contains filtered or unexported fields
}

func Content added in v1.16.1

func Content(length int64) Progress

func Response added in v1.16.1

func Response(res *http.Response) *Progress

func (Progress) Print added in v1.16.1

func (p Progress) Print()

func (Progress) Range added in v1.16.1

func (p Progress) Range() string

func (*Progress) Read added in v1.16.1

func (p *Progress) Read(buf []byte) (int, error)

type Text

type Text []byte

func (Text) String

func (t Text) String() string

Jump to

Keyboard shortcuts

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