Documentation
¶
Index ¶
- func DefaultConfig() *config.Config
- func LoadConfig(path string) (*config.Config, error)
- func NewResource(model interface{}) *resource.Resource
- type AdminUser
- type AssociationData
- type AuditLog
- type Chart
- type ChartWidget
- type Config
- type Field
- type Page
- type PageData
- type Permission
- type Registry
- func (reg *Registry) AddChart(l, t string, p func(db *gorm.DB) ([]string, []float64))
- func (reg *Registry) AddPage(n, g string, h http.HandlerFunc)
- func (reg *Registry) Create(resourceName string, data interface{}) error
- func (reg *Registry) Delete(resourceName string, id interface{}) error
- func (reg *Registry) Get(resourceName string, id interface{}) (interface{}, error)
- func (reg *Registry) GetResource(n string) (*resource.Resource, bool)
- func (reg *Registry) GetUserFromRequest(r *http.Request) (*models.AdminUser, string)
- func (reg *Registry) IsAllowed(role, resource, action string) bool
- func (reg *Registry) List(resourceName string) (interface{}, error)
- func (reg *Registry) RecordAction(user *models.AdminUser, resName, recordID, action, changes string)
- func (reg *Registry) Register(m interface{}) *resource.Resource
- func (reg *Registry) RenderCustomPage(w http.ResponseWriter, r *http.Request, title string, content template.HTML)
- func (reg *Registry) ResourceNames() []string
- func (reg *Registry) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (reg *Registry) SetConfig(c *config.Config)
- func (reg *Registry) Update(resourceName string, data interface{}) error
- type Resource
- type Scope
- type Session
- type Stat
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewResource ¶
Types ¶
type AssociationData ¶
type ChartWidget ¶
type Page ¶
type Page struct {
Name, Group string
Handler http.HandlerFunc
}
type PageData ¶
type PageData struct {
SiteTitle string
Resources map[string]*resource.Resource
GroupedResources map[string][]*resource.Resource
GroupedPages map[string][]*Page
CurrentResource *resource.Resource
Fields []resource.Field
Data []map[string]interface{}
Item map[string]interface{}
Filters map[string]string
User *models.AdminUser
Stats []Stat
Error string
Flash string
CSS template.CSS
Page, PerPage int
TotalPages int
TotalCount int64
HasPrev, HasNext bool
PrevPage, NextPage int
Scopes []resource.Scope
CurrentScope string
Associations map[string]AssociationData
ChartData []ChartWidget
SortField string
SortOrder string
RenderedSidebars map[string]template.HTML
}
type Permission ¶
type Permission = models.Permission
type Registry ¶
type Registry struct {
DB *gorm.DB
Resources map[string]*resource.Resource
Pages map[string]*Page
Charts []Chart
Config *config.Config
}
func NewRegistry ¶
func (*Registry) GetResource ¶
func (*Registry) GetUserFromRequest ¶
func (*Registry) RecordAction ¶
func (*Registry) RenderCustomPage ¶
func (*Registry) ResourceNames ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.