nova

package
v0.0.0-20260608 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Admin

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

Admin is the Nova admin panel

func New

func New() *Admin

New creates a new Nova admin panel

func (*Admin) Handler

func (a *Admin) Handler() http.Handler

Handler returns the HTTP handler

func (*Admin) Panel

func (a *Admin) Panel(panel *Panel)

Panel adds a dashboard panel

func (*Admin) Resource

func (a *Admin) Resource(name string, resource *Resource)

Resource registers a new resource

func (*Admin) SetAuthFunc

func (a *Admin) SetAuthFunc(fn func(r *http.Request) bool)

SetAuthFunc sets the authentication function

type Field

type Field struct {
	Name     string
	Label    string
	Type     string   // text, number, email, password, select, textarea, boolean, date
	Options  []string // For select fields
	Required bool
}

Field represents a field in a resource

type Panel

type Panel struct {
	Title string
	Stats []Stat
}

Panel represents a dashboard panel

type Resource

type Resource struct {
	Name      string
	TableName string
	Fields    []Field
	GetAll    func() ([]map[string]any, error)
	GetByID   func(id string) (map[string]any, error)
	Create    func(data map[string]any) error
	Update    func(id string, data map[string]any) error
	Delete    func(id string) error
}

Resource represents a resource that can be managed in Nova

type Stat

type Stat struct {
	Label string
	Value string
	Type  string // info, success, warning, danger
}

Stat represents a dashboard statistic

Jump to

Keyboard shortcuts

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