Help us shape the future of Go! Take the 2026 Go Developer Survey

target

package
v0.1.14 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2026 License: MIT Imports: 22 Imported by: 0

Documentation

Overview

Package target reads a built page and its embedded resources for page checks.

Index

Constants

This section is empty.

Variables

View Source
var ErrUsage = errors.New("invalid check target")

ErrUsage identifies unsupported targets and source project directories.

Functions

This section is empty.

Types

type File

type File struct {
	Name      string `json:"name"`
	Bytes     int    `json:"bytes"`
	SHA256    string `json:"sha256"`
	Status    int    `json:"status"`
	Error     string `json:"error,omitempty"`
	Truncated bool   `json:"truncated,omitempty"`
}

File records inspected bytes; a truncated hash covers only the bytes read.

type Result

type Result struct {
	URL       string          `json:"url"`
	Status    int             `json:"status,omitempty"`
	Redirects []string        `json:"redirects"`
	Canonical string          `json:"canonical"`
	Identity  string          `json:"identity"`
	Lang      string          `json:"lang"`
	Files     []File          `json:"files"`
	Page      []byte          `json:"-"`
	Options   check.Options   `json:"-"`
	Browser   release.Target  `json:"-"`
	Document  *check.Document `json:"-"`
}

Result contains metadata and the inputs shared by static and browser checks.

func Read

func Read(ctx context.Context, argument, version string) (Result, error)

Read performs GETs for URLs, or confined disk reads for local targets.

Jump to

Keyboard shortcuts

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