web

package
v0.16.1 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2026 License: MIT Imports: 11 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 web is the brief session's page (itd-2610091016262335, spc-2610141709430146 step 3): the static files `abcd session page` writes, embedded in the binary. The page is plain HTML, one ES module and one stylesheet, plus the vendored, provenance-pinned editor bundle (adr-2610141949110653). It connects only to the relay the person names and to api.github.com with the person's own token, and it sends the person to github.com for sign-in and to open the pre-filled issues a session sends.

The HTML is written twice, as index.html and as 404.html, byte for byte the same: a static host such as GitHub Pages serves 404.html for a path it has no file for, which is how /<owner>/<repo>/brief/ reaches the page. Every asset the HTML loads is named from the site's root (/session.js), or from under the base path the page is written for (/abcdesign/session.js), so /<owner>/<repo>/brief loads them with or without its trailing slash; the page then adds the slash.

Index

Constants

View Source
const Generator = `<meta name="generator" content="abcd session page">`

Generator is the line the page's HTML carries, which is how a later run knows a directory holding the page's files as one it wrote.

View Source
const RelayMarker = `<meta name="abcd-session-relay" content="self">`

RelayMarker is the line the page carries when the relay serves it itself (a local session): the page then takes its own origin as its relay.

Variables

This section is empty.

Functions

func RelayFiles

func RelayFiles() map[string][]byte

RelayFiles is the page as a local session's relay serves it itself, keyed by the path it is served at: the page's files at the site's root, its HTML as "index.html" carrying RelayMarker once, and no 404.html, since the relay answers the brief's path itself.

Types

type File

type File struct {
	Path string // slash-separated, relative to the output directory
	Data []byte
}

File is one file the page is made of.

func Files

func Files(base string) []File

Files is every file the page is made of, in the order they are written, for a site served under base, a path normaliseBasePath returned ("/" is the root, whose files are the embedded assets byte for byte).

type Refusal

type Refusal struct{ Reason string }

Refusal is a directory Write will not write into; nothing was written.

func (*Refusal) Error

func (r *Refusal) Error() string

type Result

type Result struct {
	Out   string   `json:"out"`
	Files []string `json:"files"`
	Bytes int64    `json:"bytes"`
	// BasePath is the path the site is served under, "/" at the root.
	BasePath string `json:"base_path"`
	// Replaced is true when the directory held an earlier copy of the page.
	Replaced bool `json:"replaced"`
}

Result is what Write did.

func Write

func Write(out, basePath string) (Result, error)

Write writes the page's files, for a site served under basePath, into out and nothing else. out may be absent or empty; a directory holding anything but the page's own files, or holding them without the page's own index.html, is refused untouched. Nothing is ever removed: an earlier copy of the page is overwritten file by file.

Jump to

Keyboard shortcuts

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