webtech

package
v0.16.4 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2026 License: BSD-3-Clause, GPL-3.0 Imports: 16 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package webtech recognizes advertised, transaction-scoped web technology. Descriptors select bounded parsers, never probes, regex programs or scripts.

Index

Constants

View Source
const (
	FileName     = "webtech-descriptors.json"
	MaxCatalogue = 64 << 10
	MaxPrefix    = 64 << 10
	MaxTag       = 4 << 10
	MaxAggregate = 16 << 20
)

Variables

This section is empty.

Functions

func DescriptorBytes

func DescriptorBytes() []byte

func Load

func Load(root string) (*Engine, Status)

func Root

func Root() string

Types

type Attribution

type Attribution struct {
	Review          json.RawMessage `json:"review"`
	Notice          string          `json:"notice"`
	FirstPartyGrant string          `json:"first_party_grant"`
	ThirdPartyGrant string          `json:"third_party_grant"`
}

func ResourceAttribution

func ResourceAttribution() Attribution

type Catalogue

type Catalogue struct {
	Format        string `json:"format"`
	SchemaVersion int    `json:"schema_version"`
	Rules         []Rule `json:"rules"`
}

type Engine

type Engine struct {
	// contains filtered or unexported fields
}

func Builtin

func Builtin() *Engine

func Parse

func Parse(b []byte) (*Engine, error)

func (*Engine) Observe

func (e *Engine) Observe(o Observation) Report

func (*Engine) ObserveReader

func (e *Engine) ObserveReader(o Observation, body io.Reader, encoding string) Report

ObserveReader drains the wire body without retaining it. The lease includes input, output and a codec reservation; concurrent capture fails visibly at 16 MiB.

func (*Engine) RuleCount

func (e *Engine) RuleCount() int

type Observation

type Observation struct {
	Method      string
	Status      int
	ContentType string
	Generator   []string
	Body        []byte
	BodyState   string
}

type Report

type Report struct {
	BodyState           string   `json:"body_state"`
	Matches             []Result `json:"matches"`
	DetectedContentType string   `json:"-"`
	WireBytes           int64    `json:"-"`
}

type Result

type Result struct {
	ID        string `json:"id"`
	Product   string `json:"product"`
	Version   string `json:"version"`
	Precision string `json:"precision"`
}

type Rule

type Rule struct {
	ID        string `json:"id"`
	Product   string `json:"product"`
	Selector  string `json:"selector"`
	Token     string `json:"token"`
	Precision string `json:"precision"`
	Method    string `json:"method"`
	Status    int    `json:"status"`
}

type Status

type Status struct {
	State  string `json:"state"`
	SHA256 string `json:"sha256"`
	Rules  int    `json:"rules"`
}

Directories

Path Synopsis
cmd
prepare command
qualify command
Package publication prepares the two optional catalogues and their scoped source evidence.
Package publication prepares the two optional catalogues and their scoped source evidence.
Package testfixture creates synthetic signing material, never a production grant.
Package testfixture creates synthetic signing material, never a production grant.

Jump to

Keyboard shortcuts

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