changesapp

package
v0.0.0-...-c858694 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2024 License: MIT Imports: 33 Imported by: 0

Documentation

Overview

Package changesapp is a change tracking web app.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(cs change.Service, us users.Service, redirect func(*url.URL), opt Options) *app

Types

type Options

type Options struct {
	// Notification, if not nil, is used to highlight changes containing
	// unread notifications, and to mark changes that are viewed as read.
	Notification notification.Service

	// BodyTop provides components to include at the top of the <body> element. It can be nil.
	BodyTop func(context.Context, State) ([]htmlg.Component, error)
}

Options for configuring changes app.

type State

type State struct {
	ReqURL      *url.URL
	CurrentUser users.User
	RepoSpec    string
	BaseURL     string // Must have no trailing slash. Can be empty string.

	ChangeID uint64 // ChangeID is the current change ID, or 0 if not applicable (e.g., current page is '/').

	PrevSHA string // PrevSHA is the previous commit SHA, or empty if not applicable (e.g., current page is not /{changeID}/files/{commitID}).
	NextSHA string // NextSHA is the next commit SHA, or empty if not applicable (e.g., current page is not /{changeID}/files/{commitID}).
}

func (State) RequestURL

func (s State) RequestURL() *url.URL

Directories

Path Synopsis
Package component contains individual components that can render themselves as HTML.
Package component contains individual components that can render themselves as HTML.

Jump to

Keyboard shortcuts

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