{"modulePath":"github.com/dracory/nodeadmin","version":"v0.4.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package nodeadmin\n\nPackage nodeadmin provides a mountable admin interface for the nodestore-backed node domain, following the same dracory admin module pattern as flowadmin.\n\nThe package exposes a single entry point, New(Options), which returns an http.Handler that the host application can mount under any path on any router (net/http ServeMux, chi, gin, echo, etc.).\n\nThe admin UI surface is one Handle(w, r) mounted at \"/\" dispatching on the ?controller= query parameter through a routes map built once at construction (default: the home dashboard). Sections are functions (section.UI(uiConfig).SectionName(w, r)); outer chrome is host-owned through Options.FuncLayout, falling back to shared.Layout. The API is served under /api/\\* by the api subpackage backed by nodestore.\n\n## Variables\n\n```go\nvar ErrStoreRequired = errors.New(\"nodeadmin: store is required\")\n```\nErrStoreRequired is returned by New when Options.Store is nil\n\n## Types\n\n```go\ntype Interface interface {\n\thttp.Handler\n\t// Handle is the single admin-surface entry point: the\n\t// ?controller= query parameter is dispatched through the routes\n\t// map built once at construction.\n\tHandle(w http.ResponseWriter, r *http.Request)\n\t// HTTPRouter returns the shared-listener adapter mounted on this\n\t// handler — the nodebase.HTTPRouter the engine is wired with at New.\n\t// Routes registered through it serve on this handler, behind the\n\t// same access check.\n\tHTTPRouter() nodebase.HTTPRouter\n}\n```\nInterface defines the node admin. It is a standard http.Handler and can be mounted on any router.\n\n```go\nfunc New(opts Options) (Interface, error)\n```\nNew creates a new node admin instance. Returns ErrStoreRequired if Options.Store is nil.\n\n```go\ntype Options struct {\n\t// Store is the nodestore.StoreInterface used for persistence\n\t// (required).\n\tStore nodestore.StoreInterface\n\n\t// IsAccessAllowed reports whether the request may use the admin.\n\t// Authentication is host-owned (GOD ruling 2026-11-25): sessions,\n\t// login, users and roles all live outside this package — it only\n\t// asks this one question per request. Nil means open (standalone\n\t// or dev mode).\n\tIsAccessAllowed func(r *http.Request) bool\n\n\t// OnUnauthorized writes the response for a request IsAccessAllowed\n\t// denied — the host decides: a redirect to its login page, a JSON\n\t// 401 for API clients, etc. Nil replies \"authentication required\"\n\t// with status 401.\n\tOnUnauthorized func(w http.ResponseWriter, r *http.Request)\n\n\t// GetAuthUserID returns the authenticated user's ID for display\n\t// and audit purposes only — it is never consulted for the access\n\t// decision. Optional.\n\tGetAuthUserID func(r *http.Request) string\n\n\t// AdminHomeURL is the admin home link exposed to sections through\n\t// the request context (default: \"/\").\n\tAdminHomeURL string\n\n\t// NodeAdminURL is the base URL the node admin is mounted on —\n\t// injected into the request context for section link building\n\t// (default: \"/nodes\").\n\tNodeAdminURL string\n\n\t// Engine is the engine deployed workflows run in, expressed as the\n\t// narrow api.EngineInterface contract — nodeadmin does not depend\n\t// on a concrete runner (GOD ruling 2026-11-24; the stock\n\t// noderunner.WorkflowEngine satisfies it structurally). If nil a\n\t// fresh noderunner engine is created. On mount, engines that\n\t// support it resume every workflow whose persisted deployed flag\n\t// is set (restart-resume).\n\tEngine api.EngineInterface\n\n\t// FuncLayout is an optional function to render the admin interface\n\t// inside your own layout (branding, menus, etc.). If nil, the\n\t// default shared.Layout is used.\n\tFuncLayout shared.FuncLayout\n\n\t// DisableChrome hands chrome ownership to the host: the editor —\n\t// a standalone page that bypasses FuncLayout — emits no nodeadmin\n\t// navbar or section pills so an embedding host can wrap it in its\n\t// own chrome. Sections are unaffected (they already render through\n\t// FuncLayout when set). The zero value keeps the default chrome.\n\tDisableChrome bool\n}\n```\nOptions contains all dependencies and configuration for the node admin.\n\n","path":"github.com/dracory/nodeadmin","name":"nodeadmin","synopsis":"Package nodeadmin provides a mountable admin interface for the nodestore-backed node domain, following the same dracory admin module pattern as flowadmin.","isRedistributable":true}
