detect

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractBasicMeta

func ExtractBasicMeta(doc *ihtml.Document) map[string]string

ExtractBasicMeta returns a map of metadata extracted from a Document.

Types

type Result

type Result struct {
	RawType  Type   // basic type from content sniffing
	SubType  Type   // deeper classification (article/docs)
	MIME     string // HTTP Content-Type header
	Metadata map[string]string
	Charset  string
	Encoding string
	IsBinary bool
}

Result is the internal detection output.

func Detect

func Detect(body []byte, headers http.Header) *Result

Detect performs content detection on HTTP response body and headers.

type Type

type Type string

Type represents Aether’s internal content classification.

const (
	TypeUnknown  Type = "unknown"
	TypeHTML     Type = "html"
	TypeJSON     Type = "json"
	TypeXML      Type = "xml"
	TypeRSS      Type = "rss"
	TypePDF      Type = "pdf"
	TypeText     Type = "text"
	TypeImage    Type = "image"
	TypeBinary   Type = "binary"
	TypeArticle  Type = "article"
	TypeHomepage Type = "homepage"
	TypeDocs     Type = "docs"
)

Jump to

Keyboard shortcuts

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