Documentation
¶
Index ¶
- type Action
- type ActionHandler
- type Association
- type BatchAction
- type BatchActionHandler
- type DecoratorFunc
- type Field
- type Resource
- func (r *Resource) AddBatchAction(n, l string, h BatchActionHandler) *Resource
- func (r *Resource) AddCollectionAction(n, l string, h ActionHandler) *Resource
- func (r *Resource) AddMemberAction(n, l string, h ActionHandler) *Resource
- func (r *Resource) AddScope(n, l string, h ScopeFunc) *Resource
- func (r *Resource) AddSidebar(label string, handler SidebarHandler) *Resource
- func (r *Resource) BelongsTo(n, l, tr, fk string) *Resource
- func (r *Resource) GetFieldsFor(view string) []Field
- func (r *Resource) HasMany(n, l, tr, fk string) *Resource
- func (r *Resource) RegisterField(name, label string, readonly bool) *Resource
- func (r *Resource) SetDecorator(name string, fn DecoratorFunc) *Resource
- func (r *Resource) SetEditFields(n ...string) *Resource
- func (r *Resource) SetFieldType(n, t string, opt ...string) *Resource
- func (r *Resource) SetGroup(group string) *Resource
- func (r *Resource) SetIndexFields(n ...string) *Resource
- func (r *Resource) SetSearchable(f, tr string) *Resource
- func (r *Resource) SetShowFields(n ...string) *Resource
- func (r *Resource) SetSortable(name string, sortable bool) *Resource
- type Scope
- type ScopeFunc
- type Sidebar
- type SidebarHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Action ¶
type Action struct {
Name, Label string
Handler ActionHandler
}
type ActionHandler ¶
type ActionHandler func(res *Resource, w http.ResponseWriter, r *http.Request)
type Association ¶
type Association struct{ Type, Name, ResourceName, ForeignKey, Label string }
type BatchAction ¶
type BatchAction struct {
Name, Label string
Handler BatchActionHandler
}
type BatchActionHandler ¶
type DecoratorFunc ¶
type Resource ¶
type Resource struct {
Model interface{}
Name, Path, Group string
Fields []Field
IndexFields []string
ShowFields []string
EditFields []string
MemberActions []Action
CollectionActions []Action
BatchActions []BatchAction
Scopes []Scope
Associations []Association
Sidebars []Sidebar
Attributes map[string]interface{}
}
func NewResource ¶
func NewResource(model interface{}) *Resource
func (*Resource) AddBatchAction ¶
func (r *Resource) AddBatchAction(n, l string, h BatchActionHandler) *Resource
func (*Resource) AddCollectionAction ¶
func (r *Resource) AddCollectionAction(n, l string, h ActionHandler) *Resource
func (*Resource) AddMemberAction ¶
func (r *Resource) AddMemberAction(n, l string, h ActionHandler) *Resource
func (*Resource) AddSidebar ¶
func (r *Resource) AddSidebar(label string, handler SidebarHandler) *Resource
func (*Resource) GetFieldsFor ¶
func (*Resource) RegisterField ¶
func (*Resource) SetDecorator ¶
func (r *Resource) SetDecorator(name string, fn DecoratorFunc) *Resource
func (*Resource) SetEditFields ¶
func (*Resource) SetFieldType ¶
func (*Resource) SetIndexFields ¶
func (*Resource) SetSearchable ¶
func (*Resource) SetShowFields ¶
type Sidebar ¶
type Sidebar struct {
Label string
Handler SidebarHandler
}
type SidebarHandler ¶
Click to show internal directories.
Click to hide internal directories.