packer

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: Apache-2.0 Imports: 22 Imported by: 2

Documentation

Index

Constants

View Source
const (
	MIMEHTML = "text/html"
	MIMECSS  = "text/css"
)

Content-Type MIME of the most common data formats.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option struct {
	URL         string
	FilePath    string
	Timeout     int
	ClutterFree bool
	Headers     map[string]string

	EnablePrivateNet bool
}

type Packer

type Packer interface {
	Pack(ctx context.Context, opt Option) error
	ReadContent(ctx context.Context, opt Option) (string, error)
}

func NewHtmlPacker

func NewHtmlPacker() Packer

func NewWebArchivePacker

func NewWebArchivePacker() Packer

type WebArchive

type WebArchive struct {
	WebMainResource WebResourceItem   `json:"WebMainResource"`
	WebSubresources []WebResourceItem `json:"WebSubresources"`
}

type WebResourceItem

type WebResourceItem struct {
	WebResourceURL              string `json:"WebResourceURL"`
	WebResourceMIMEType         string `json:"WebResourceMIMEType"`
	WebResourceResponse         []byte `json:"WebResourceResponse,omitempty"`
	WebResourceData             []byte `json:"WebResourceData,omitempty"`
	WebResourceTextEncodingName string `json:"WebResourceTextEncodingName,omitempty"`
}

Jump to

Keyboard shortcuts

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