admin

package
v1.0.4 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

Queue holds the registered queue interface to be monitored by the admin panel.

Functions

func All

func All() map[string]*AdminEntry

All returns all registered admin entries.

func Mount

func Mount(mux *http.ServeMux, db *sql.DB, prefix string)

Mount registers all admin panel routes onto the provided mux. db is required for dynamic CRUD queries. prefix is the URL prefix (e.g. "/admin").

func Register

func Register(model any)

Register adds a model to the global admin panel registry. The model argument should be a pointer to a struct (e.g. &model.User{}).

func SetQueue

func SetQueue(q contract.Queue)

SetQueue registers the active queue instance for dashboard inspection.

Types

type AdminEntry

type AdminEntry struct {
	ModelType reflect.Type
	TableName string
	Columns   []ColumnMeta
	Label     string // Human-readable plural name, e.g. "Users"
}

AdminEntry describes a model registered with the admin panel.

func Find

func Find(name string) (*AdminEntry, bool)

Find retrieves an admin entry by its lowercase model name.

type ColumnMeta

type ColumnMeta struct {
	Name    string // db tag / column name
	GoField string // struct field name
	Type    string // "string", "int", "bool", etc.
}

ColumnMeta describes a single column/field for admin display.

type Registry

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

Registry is the global admin model registry.

Jump to

Keyboard shortcuts

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