adminpanel

package module
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2026 License: MIT Imports: 3 Imported by: 2 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.

README

modules/adminpanel

Official Lesstruct module: the admin SPA shell served at /admin, the frozen admin API surface, and the manifest endpoint aggregating every feature module's admin extensions.

Layout (module template)

module.go            # kernel.Module (single registry-facing file)
api/                 # manifest endpoint (legacy envelope, versioned JSON)
spa/                 # embedded Vue build (dist/) + ServeAdmin + dev proxy
admin/               # admin-shell manifest (empty: the shell renders others)
testutil/            # kernel fixture for module tests

Manifest endpoint

GET /api/admin/extensions (admin-only) aggregates every registered kernel.AdminExtensionProvider in registry name order into versioned JSON:

{"version": 1, "modules": [{"name": "media", "menuEntries":
[{"label": "Media", "path": "/media", "icon": "photo"}],
"settingsSections": [], "editorExtensions": []}]}

Empty collections serialize as [], never null. The version field lets a future shell negotiate: unknown major versions must not render. Any manifest change breaks the conformance pin — that is the freeze contract.

Documentation

Overview

Package adminpanel is the official admin module: the admin SPA shell served at /admin plus the frozen admin API surface and the manifest endpoint aggregating every feature module's admin extensions.

Index

Constants

View Source
const Name = "adminpanel"

Name is the registry key for this module.

View Source
const Version = "0.1.0"

Version is the module version reported via Module.Version.

Variables

This section is empty.

Functions

This section is empty.

Types

type Module

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

Module is the adminpanel kernel module.

func New

func New(opts ...Option) *Module

New builds the module, adopting the composition root's wiring. The SPA handler is built once here so every premise serves the same instance.

func (*Module) AdminManifest

func (m *Module) AdminManifest() kernel.AdminExtensionManifest

AdminManifest declares this module's admin-shell extensions. The shell itself contributes no navigation: it renders what the other modules declare.

func (*Module) Init

func (m *Module) Init(_ kernel.Kernel) error

Init wires the module. The shell is static file serving plus the manifest aggregation, both attached in later slices; Init only validates presence.

func (*Module) Name

func (m *Module) Name() string

Name returns the registry key.

func (*Module) Optional

func (m *Module) Optional() []string

Optional lists soft dependencies. There are none: every feature module's admin extensions are discovered through the AdminExtensionProvider capability, never through a declared edge.

func (*Module) Requires

func (m *Module) Requires() []string

Requires lists hard dependencies. The shell authenticates through the auth module, matching the retired wrapper edge.

func (*Module) SPAHandler

func (m *Module) SPAHandler() *spa.Handler

SPAHandler exposes the admin SPA handler for core mounting. Core mounts it explicitly (rather than via RouteProvider) because the /admin premises share one mount point with the static server's nil-gated behavior, which a single RegisterRoutes call cannot express.

func (*Module) Shutdown

func (m *Module) Shutdown() error

Shutdown releases module resources. There are none beyond memory.

func (*Module) Version

func (m *Module) Version() string

Version returns the module version.

type Option

type Option func(*Module)

Option configures a Module. The composition root supplies every option; direct construction without options yields a standalone module serving the embedded production build.

func WithAdminDevURL

func WithAdminDevURL(adminURL string) Option

WithAdminDevURL sets the Vite dev server target used when dev mode is on.

func WithDevMode

func WithDevMode(devMode bool) Option

WithDevMode serves the admin SPA from the Vite dev server (reverse proxy) instead of the embedded production build.

Directories

Path Synopsis
Package admin owns this module's admin-shell manifest: the declarative UI the single admin SPA renders for the shell itself.
Package admin owns this module's admin-shell manifest: the declarative UI the single admin SPA renders for the shell itself.
Package spa serves the embedded admin single-page application: the production Vue build at rest plus the development-mode reverse proxy to the Vite server.
Package spa serves the embedded admin single-page application: the production Vue build at rest plus the development-mode reverse proxy to the Vite server.
Package testutil provides the kernel fixture module tests run against.
Package testutil provides the kernel fixture module tests run against.

Jump to

Keyboard shortcuts

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