Documentation
¶
Index ¶
- Constants
- func SetServices(srv service.List)
- type BaseTable
- func (base *BaseTable) GetCanAdd() bool
- func (base *BaseTable) GetDeletable() bool
- func (base *BaseTable) GetDetail() *types.InfoPanel
- func (base *BaseTable) GetEditable() bool
- func (base *BaseTable) GetExportable() bool
- func (base *BaseTable) GetForm() *types.FormPanel
- func (base *BaseTable) GetInfo() *types.InfoPanel
- func (base *BaseTable) GetPaginator(size int, params parameter.Parameters, extraHtml ...template.HTML) types.PaginatorAttribute
- func (base *BaseTable) GetPrimaryKey() PrimaryKey
- func (base *BaseTable) IsShowDetail() bool
- type Columns
- type Config
- func (config Config) SetCanAdd(canAdd bool) Config
- func (config Config) SetConnection(connection string) Config
- func (config Config) SetDeletable(deletable bool) Config
- func (config Config) SetEditable(editable bool) Config
- func (config Config) SetExportable(exportable bool) Config
- func (config Config) SetGetDataFun(fun GetDataFun) Config
- func (config Config) SetPrimaryKeyType(typ string) Config
- func (config Config) SetSourceURL(url string) Config
- type DefaultTable
- func (tb DefaultTable) Copy() Table
- func (tb DefaultTable) DeleteData(id string) error
- func (tb DefaultTable) GetData(params parameter.Parameters) (PanelInfo, error)
- func (tb DefaultTable) GetDataWithId(param parameter.Parameters) (FormInfo, error)
- func (tb DefaultTable) GetDataWithIds(params parameter.Parameters) (PanelInfo, error)
- func (tb DefaultTable) GetNewForm() FormInfo
- func (tb DefaultTable) InsertData(dataList form.Values) error
- func (tb DefaultTable) UpdateData(dataList form.Values) error
- type FormInfo
- type Generator
- type GeneratorList
- type GetDataFromURLRes
- type GetDataFun
- type PanelInfo
- type PrimaryKey
- type SystemTable
- func (s *SystemTable) GetManagerTable(ctx *context.Context) (ManagerTable Table)
- func (s *SystemTable) GetMenuTable(ctx *context.Context) (MenuTable Table)
- func (s *SystemTable) GetNormalManagerTable(ctx *context.Context) (ManagerTable Table)
- func (s *SystemTable) GetOpTable(ctx *context.Context) (OpTable Table)
- func (s *SystemTable) GetPermissionTable(ctx *context.Context) (PermissionTable Table)
- func (s *SystemTable) GetRolesTable(ctx *context.Context) (RolesTable Table)
- type Table
Constants ¶
View Source
const ( DefaultPrimaryKeyName = "id" DefaultConnectionName = "default" )
Variables ¶
This section is empty.
Functions ¶
func SetServices ¶ added in v1.1.2
Types ¶
type BaseTable ¶ added in v1.2.5
type BaseTable struct {
Info *types.InfoPanel
Form *types.FormPanel
Detail *types.InfoPanel
CanAdd bool
Editable bool
Deletable bool
Exportable bool
PrimaryKey PrimaryKey
}
func (*BaseTable) GetDeletable ¶ added in v1.2.5
func (*BaseTable) GetEditable ¶ added in v1.2.5
func (*BaseTable) GetExportable ¶ added in v1.2.5
func (*BaseTable) GetPaginator ¶ added in v1.2.5
func (base *BaseTable) GetPaginator(size int, params parameter.Parameters, extraHtml ...template.HTML) types.PaginatorAttribute
func (*BaseTable) GetPrimaryKey ¶ added in v1.2.5
func (base *BaseTable) GetPrimaryKey() PrimaryKey
func (*BaseTable) IsShowDetail ¶ added in v1.2.5
type Config ¶
type Config struct {
Driver string
Connection string
CanAdd bool
Editable bool
Deletable bool
Exportable bool
PrimaryKey PrimaryKey
SourceURL string
GetDataFun GetDataFun
}
func DefaultConfig ¶
func DefaultConfig() Config
func DefaultConfigWithDriver ¶
func (Config) SetConnection ¶
func (Config) SetDeletable ¶
func (Config) SetEditable ¶
func (Config) SetExportable ¶
func (Config) SetGetDataFun ¶ added in v1.1.8
func (config Config) SetGetDataFun(fun GetDataFun) Config
func (Config) SetPrimaryKeyType ¶
func (Config) SetSourceURL ¶ added in v1.1.8
type DefaultTable ¶
type DefaultTable struct {
*BaseTable
// contains filtered or unexported fields
}
func (DefaultTable) Copy ¶ added in v1.1.6
func (tb DefaultTable) Copy() Table
func (DefaultTable) DeleteData ¶ added in v1.2.5
func (tb DefaultTable) DeleteData(id string) error
DeleteData delete data.
func (DefaultTable) GetData ¶ added in v1.1.8
func (tb DefaultTable) GetData(params parameter.Parameters) (PanelInfo, error)
GetData query the data set.
func (DefaultTable) GetDataWithId ¶ added in v1.1.8
func (tb DefaultTable) GetDataWithId(param parameter.Parameters) (FormInfo, error)
GetDataWithId query the single row of data.
func (DefaultTable) GetDataWithIds ¶ added in v1.1.8
func (tb DefaultTable) GetDataWithIds(params parameter.Parameters) (PanelInfo, error)
GetDataWithIds query the data set.
func (DefaultTable) GetNewForm ¶ added in v1.2.5
func (tb DefaultTable) GetNewForm() FormInfo
func (DefaultTable) InsertData ¶ added in v1.2.5
func (tb DefaultTable) InsertData(dataList form.Values) error
InsertData insert data.
func (DefaultTable) UpdateData ¶ added in v1.2.5
func (tb DefaultTable) UpdateData(dataList form.Values) error
UpdateData update data.
type FormInfo ¶ added in v1.2.5
type FormInfo struct {
FieldList types.FormFields
GroupFieldList types.GroupFormFields
GroupFieldHeaders types.GroupFieldHeaders
Title string
Description string
}
type GeneratorList ¶
func (GeneratorList) Add ¶
func (g GeneratorList) Add(key string, gen Generator)
func (GeneratorList) Combine ¶ added in v1.1.6
func (g GeneratorList) Combine(gg GeneratorList) GeneratorList
func (GeneratorList) CombineAll ¶ added in v1.1.6
func (g GeneratorList) CombineAll(ggg []GeneratorList) GeneratorList
func (GeneratorList) InjectRoutes ¶ added in v1.1.8
func (g GeneratorList) InjectRoutes(app *context.App, srv service.List)
type GetDataFromURLRes ¶ added in v1.1.8
type GetDataFun ¶ added in v1.1.8
type GetDataFun func(params parameter.Parameters) ([]map[string]interface{}, int)
type PanelInfo ¶
type PanelInfo struct {
Thead types.Thead
InfoList types.InfoList
FilterFormData types.FormFields
Paginator types.PaginatorAttribute
Title string
Description string
}
type PrimaryKey ¶
type PrimaryKey struct {
Type db.DatabaseType
Name string
}
type SystemTable ¶ added in v1.2.5
type SystemTable struct {
// contains filtered or unexported fields
}
func NewSystemTable ¶ added in v1.2.5
func NewSystemTable(conn db.Connection) *SystemTable
func (*SystemTable) GetManagerTable ¶ added in v1.2.5
func (s *SystemTable) GetManagerTable(ctx *context.Context) (ManagerTable Table)
func (*SystemTable) GetMenuTable ¶ added in v1.2.5
func (s *SystemTable) GetMenuTable(ctx *context.Context) (MenuTable Table)
func (*SystemTable) GetNormalManagerTable ¶ added in v1.2.5
func (s *SystemTable) GetNormalManagerTable(ctx *context.Context) (ManagerTable Table)
func (*SystemTable) GetOpTable ¶ added in v1.2.5
func (s *SystemTable) GetOpTable(ctx *context.Context) (OpTable Table)
func (*SystemTable) GetPermissionTable ¶ added in v1.2.5
func (s *SystemTable) GetPermissionTable(ctx *context.Context) (PermissionTable Table)
func (*SystemTable) GetRolesTable ¶ added in v1.2.5
func (s *SystemTable) GetRolesTable(ctx *context.Context) (RolesTable Table)
type Table ¶
type Table interface {
GetInfo() *types.InfoPanel
GetDetail() *types.InfoPanel
GetForm() *types.FormPanel
GetCanAdd() bool
GetEditable() bool
GetDeletable() bool
GetExportable() bool
IsShowDetail() bool
GetPrimaryKey() PrimaryKey
GetData(params parameter.Parameters) (PanelInfo, error)
GetDataWithIds(params parameter.Parameters) (PanelInfo, error)
GetDataWithId(params parameter.Parameters) (FormInfo, error)
UpdateData(dataList form.Values) error
InsertData(dataList form.Values) error
DeleteData(id string) error
GetNewForm() FormInfo
Copy() Table
}
func NewDefaultTable ¶
Click to show internal directories.
Click to hide internal directories.