web

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 28, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package web wires the chi router, templ views, and static assets that make up the snapdiff review UI.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FinalizeFunc

type FinalizeFunc func(items []*review.Item) error

FinalizeFunc is invoked when the reviewer hits Finalize. It receives the items in their session order; the implementation typically calls internal/apply and records the result for the cmd to emit on stdout.

type GalleryServer

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

GalleryServer exposes a read-only baseline-browsing UI. It is independent of the diff-review Server: no session, no verdicts, no finalize.

func NewGalleryServer

func NewGalleryServer(items []gallery.Item, repoDir, publicURL string) *GalleryServer

NewGalleryServer wires the gallery router. The caller owns the lifecycle.

func (*GalleryServer) Handler

func (g *GalleryServer) Handler() http.Handler

Handler returns the http.Handler suitable to mount on an http.Server.

func (*GalleryServer) PublicURL

func (g *GalleryServer) PublicURL() string

PublicURL is the URL that the cmd prints to stdout.

func (*GalleryServer) SetRepoLabel

func (g *GalleryServer) SetRepoLabel(label string)

SetRepoLabel customizes the namespace shown in the brand area.

type Server

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

Server bundles the session, the pixel-diff cache, and a finalize callback behind an http.Handler.

func NewServer

func NewServer(s *review.Session, d *imdiff.Differ, publicURL string, onFinalize FinalizeFunc) *Server

NewServer assembles the router.

func (*Server) Handler

func (s *Server) Handler() http.Handler

Handler returns the http.Handler suitable to mount on an http.Server.

func (*Server) PublicURL

func (s *Server) PublicURL() string

PublicURL is the URL that the cmd prints to stdout for the reviewer.

func (*Server) SetRepoLabel

func (s *Server) SetRepoLabel(label string)

SetRepoLabel customizes the namespace shown in the brand area (e.g. "ios-app/").

Directories

Path Synopsis
templ: version: v0.3.1020
templ: version: v0.3.1020

Jump to

Keyboard shortcuts

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