home

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package home holds the Githome web front's landing surface: the root page at / and its named twin at /dashboard. The root switches on the viewer the session middleware resolved: a signed-in viewer gets the dashboard (their repositories and their recent activity), an anonymous one the sign-in landing. /dashboard is the same dashboard at a stable URL, so a bookmark survives being signed out: an anonymous request there bounces to the sign-in form with return_to, the settings rule, because the page is function-private rather than secret. Both routes render the same template from the same model, so the two URLs can never drift apart. The feed reads the viewer's own event timeline through the same catalog the profile timeline uses (fe/web/profile.FeedItems); Githome has no follow graph, so "your feed" is honestly your own recent activity, not a faked network feed. See Spec 2005 docs 02 and 04.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Deps

type Deps struct {
	Repos  *domain.RepoService
	Events *domain.EventService
	Render *render.Set
	View   *view.Builder
	Logger *slog.Logger
}

Deps are the home handlers' dependencies: the repo service for the sidebar list, the event service for the activity feed, the render set, the view builder for the chrome, and a logger. Either service may be nil; the dashboard then renders without that panel, the same degrade the profile takes.

type Handlers

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

Handlers is the home handler set. One is built at boot and shared; it holds no per-request state.

func New

func New(d Deps) *Handlers

New wires the handler set from its dependencies.

func (*Handlers) Dashboard

func (h *Handlers) Dashboard(c *mizu.Ctx) error

Dashboard serves /dashboard, the dashboard's stable URL. An anonymous request bounces to the sign-in form with return_to carrying the page, so a signed-out bookmark lands back here after the sign-in.

func (*Handlers) Index

func (h *Handlers) Index(c *mizu.Ctx) error

Index serves /: the dashboard for a signed-in viewer, the sign-in landing for an anonymous one.

Jump to

Keyboard shortcuts

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