serve

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package serve hosts distilled artifacts with content negotiation.

The negotiation rule is simple and it is the point: an agent gets the distilled content, a human gets sent to the real site. A person should read the page the designer built; an agent should read the version that costs a tenth of the tokens.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

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

Handler serves artifacts.

func New

func New(opts Options) (*Handler, error)

New scans a directory of artifacts.

func (*Handler) Artifacts

func (h *Handler) Artifacts() []string

Artifacts lists the served artifact names.

func (*Handler) ServeHTTP

func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type Options

type Options struct {
	// Root is the directory holding artifact directories.
	Root string
	// RedirectHumans sends browsers to the original URL.
	RedirectHumans bool
}

Options configures the server.

Jump to

Keyboard shortcuts

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