admin

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package admin provides an EnginePlugin that serves the admin dashboard UI and loads admin config routes. It encapsulates admin concerns — static file serving, config merging, and service delegate wiring — as a self-contained plugin rather than hard-wired logic in cmd/server/main.go.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Plugin

type Plugin struct {
	plugin.BaseEnginePlugin

	// UIDir overrides the static file root for the admin dashboard.
	// Empty string means use the default from admin/config.yaml.
	UIDir string

	// Logger for wiring hook diagnostics.
	Logger *slog.Logger
}

Plugin provides admin-specific module types and wiring hooks:

  • admin.dashboard — serves the admin UI static files via a static.fileserver
  • admin.config_loader — loads admin/config.yaml and merges routes into the engine

func New

func New() *Plugin

New creates a new admin plugin.

func (*Plugin) Capabilities

func (p *Plugin) Capabilities() []capability.Contract

Capabilities returns the capability contracts this plugin defines.

func (*Plugin) ModuleFactories

func (p *Plugin) ModuleFactories() map[string]plugin.ModuleFactory

ModuleFactories returns factories for admin module types.

func (*Plugin) ModuleSchemas

func (p *Plugin) ModuleSchemas() []*schema.ModuleSchema

ModuleSchemas returns UI schema definitions for admin module types.

func (*Plugin) WiringHooks

func (p *Plugin) WiringHooks() []plugin.WiringHook

WiringHooks returns post-init wiring functions that merge admin config into the running engine.

func (*Plugin) WithLogger

func (p *Plugin) WithLogger(logger *slog.Logger) *Plugin

WithLogger sets the logger for wiring hook diagnostics.

func (*Plugin) WithUIDir

func (p *Plugin) WithUIDir(dir string) *Plugin

WithUIDir sets the static file root for the admin dashboard.

Jump to

Keyboard shortcuts

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