admin

package
v0.0.0-...-63f4637 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2020 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdderAdminResources

type AdderAdminResources interface {
	AddResource(value interface{}, config ...*admin.Config) *admin.Resource
}

AdderAdminResources adds resources to the admin

type Admin

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

Admin is the admin struct.

func NewAdmin

func NewAdmin(db *gorm.DB) *Admin

NewAdmin returns a new admin object.

func (*Admin) MountTo

func (a *Admin) MountTo(mountTo string, mux *http.ServeMux)

MountTo mounts the admin to the mux

func (*Admin) RegisterApp

func (a *Admin) RegisterApp(apl interface{ ResourcesAdder })

RegisterApp register the applications.

type CrudMixin

type CrudMixin struct{}

CrudMixin is a mixin for applying the base CRUD pages

func (*CrudMixin) Apply

func (m *CrudMixin) Apply(
	resource interface{ Resource },
	config interface{ MixinConfig },
)

Apply applyes the mixin to the resource

type MixinConfig

type MixinConfig interface {
	GetListFields() []interface{}
	GetEditFields() []interface{}
}

MixinConfig is the admin config for mixins

type Resource

Resource is the admin resource interface.

type ResourceEditAdder

type ResourceEditAdder interface {
	NewAttrs(values ...interface{}) []*admin.Section
	EditAttrs(values ...interface{}) []*admin.Section
}

ResourceEditAdder adds new and edit attributes

type ResourceFilterAdder

type ResourceFilterAdder interface {
	Filter(filter *admin.Filter)
}

ResourceFilterAdder adds filters

type ResourceIndexAdder

type ResourceIndexAdder interface {
	IndexAttrs(values ...interface{}) []*admin.Section
	ShowAttrs(values ...interface{}) []*admin.Section
}

ResourceIndexAdder adds index and show attributes

type ResourcesAdder

type ResourcesAdder interface {
	AddAdminResources(admin interface{ AdderAdminResources })
}

ResourcesAdder add the app admin resources

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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