shot

package
v0.2.0-rc6 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2026 License: Apache-2.0 Imports: 17 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 shot is `dd-worker shot`: dd-shot's browser driver for a Stack sign-in (job stack S10). It starts the host browser with a DevTools endpoint on loopback, signs in as the stack's seed user (a form, or an HTTP call made from the page so the session cookie lands in the browser), checks the sign-in, then screenshots each path. It speaks the Chrome DevTools Protocol over the websocket library the worker already uses, so nothing is installed at run time.

It prints dd-shot's status lines only and never a credential:

DD-SHOT SIGNIN OK <form|http>
DD-SHOT FAIL <DEF-id> signin <reason>
DD-SHOT OK <DEF-id> <file> <bytes>B <path>
DD-SHOT FAIL <DEF-id> <path> no-png <reason>

A failed sign-in takes no screenshot.

Index

Constants

View Source
const (
	ExitOK   = 0
	ExitFail = 1
)

Status codes, as dd-shot's.

Variables

This section is empty.

Functions

func Run

func Run(ctx context.Context, o Options) int

Run signs in and screenshots; it returns ExitOK when every screenshot was written.

Types

type Options

type Options struct {
	Browser string          // the host browser (policy agent_browser)
	SignIn  exec.ShotSignIn // from dd-shot-signin.json
	Def     string          // the defect id, for the status lines
	Dir     string          // fix-evidence/<DEF-id>
	After   int             // the highest fix-NN already there
	AppURL  string          // the app's URL, no trailing slash
	Paths   []string        // the pages to screenshot
	Timeout time.Duration   // each page's bound, and the sign-in's
	Out     io.Writer
}

Options is one `dd-worker shot` call.

Jump to

Keyboard shortcuts

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