Versions in this module Expand all Collapse all v0 v0.26.0 Jun 25, 2026 Changes in this version type Option + func WithInsecureAllowAll() Option v0.25.0 Jun 25, 2026 v0.24.0 Jun 24, 2026 Changes in this version + const ActionCreate + const ActionDelete + const ActionList + const ActionUpdate + const ActionView + const DefaultPerPage + var ErrNotFound = errors.New("admin: record not found") + type Authorizer func(r *http.Request, action, model string) bool + type DataSource interface + Create func(ctx context.Context, data map[string]any) (map[string]any, error) + Delete func(ctx context.Context, id string) error + Get func(ctx context.Context, id string) (map[string]any, error) + List func(ctx context.Context, params ListParams) (rows []map[string]any, total int, err error) + Update func(ctx context.Context, id string, data map[string]any) (map[string]any, error) + type Field struct + Column string + Editable bool + InList bool + IsCreatedAt bool + IsDeletedAt bool + IsPrimary bool + IsRelation bool + IsUpdatedAt bool + Kind string + Label string + Name string + type ListParams struct + Filters map[string]string + IncludeDeleted bool + Page int + PerPage int + Search string + SearchFields []string + SoftDeleteColumn string + type Option func(*Panel) + func WithAuthorizer(a Authorizer) Option + func WithBasePath(base string) Option + func WithTitle(title string) Option + type Panel struct + func New(opts ...Option) *Panel + func (p *Panel) Handler() http.Handler + func (p *Panel) HomeURL() string + func (p *Panel) Register(model any, cfg Resource) + func (p *Panel) Title() string + type Resource struct + Columns []string + Editable []string + Filters []string + Label string + PerPage int + Search []string + Slug string + Source DataSource + type SliceSource struct + func NewSliceSource(pkColumn string) *SliceSource + func (s *SliceSource) Create(_ context.Context, data map[string]any) (map[string]any, error) + func (s *SliceSource) Delete(_ context.Context, id string) error + func (s *SliceSource) Get(_ context.Context, id string) (map[string]any, error) + func (s *SliceSource) Len() int + func (s *SliceSource) List(_ context.Context, params ListParams) ([]map[string]any, int, error) + func (s *SliceSource) Seed(rows ...map[string]any) + func (s *SliceSource) Update(_ context.Context, id string, data map[string]any) (map[string]any, error)