admin

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2026 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DeleteAction = "delete"
)
View Source
const (
	RetryAction = "retry"
)

Variables

View Source
var (
	ErrReservedSlug  = errors.New("coyote/admin: that path is reserved by the portal")
	ErrDuplicateSlug = errors.New("coyote/admin: a resource is already registered on that path")
	ErrNotMountedYet = errors.New("coyote/admin: Manage must be called after Mount")
)
View Source
var ErrUnknownResource = errors.New("coyote/admin: no resource registered for that path")

Functions

This section is empty.

Types

type Action

type Action struct {
	Name       string
	Label      string
	Confirm    string
	Permission string
	Run        func(r *http.Request, ids []string) (int, error)
}

type Actionable

type Actionable interface {
	Actions() []Action
}

type Admin

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

func Mount

func Mount(application *app.App) *Admin

func (*Admin) Manage

func (a *Admin) Manage(resources ...Resource) error

func (*Admin) Managed

func (a *Admin) Managed() []string

func (*Admin) MustManage

func (a *Admin) MustManage(resources ...Resource)

func (*Admin) Prefix

func (a *Admin) Prefix() string

func (*Admin) Register

func (a *Admin) Register(s Section)

type Concealed

type Concealed interface {
	HiddenColumns() []string
}

type Filterable

type Filterable interface {
	FilterColumns() []string
}

type Guarded

type Guarded interface {
	ReadOnly() bool
}

type Labelled

type Labelled interface {
	Label() string
}

type Listed

type Listed interface {
	ListColumns() []string
}

type Pluralised

type Pluralised interface {
	PluralLabel() string
}

type Resource

type Resource interface {
	Entity() any
}

type Routed

type Routed interface {
	Slug() string
}

type Searchable

type Searchable interface {
	SearchColumns() []string
}

type Section

type Section struct {
	Name        string
	Slug        string
	Description string
	Handler     http.Handler
}

type Sorted

type Sorted interface {
	DefaultOrder() string
}

Jump to

Keyboard shortcuts

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