Documentation ¶
Index ¶
- Constants
- func SetServices(srv service.List)
- type BaseTable
- func (base *BaseTable) GetActualNewForm() *types.FormPanel
- func (base *BaseTable) GetCanAdd() bool
- func (base *BaseTable) GetDeletable() bool
- func (base *BaseTable) GetDetail() *types.InfoPanel
- func (base *BaseTable) GetDetailFromInfo() *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) GetNewForm() *types.FormPanel
- func (base *BaseTable) GetOnlyDetail() bool
- func (base *BaseTable) GetOnlyInfo() bool
- func (base *BaseTable) GetOnlyNewForm() bool
- func (base *BaseTable) GetOnlyUpdateForm() bool
- func (base *BaseTable) GetPaginator(ctx *context.Context, size int, params parameter.Parameters, ...) types.PaginatorAttribute
- func (base *BaseTable) GetPrimaryKey() PrimaryKey
- 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) SetDriverMode(mode string) 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) SetOnlyDetail() Config
- func (config Config) SetOnlyInfo() Config
- func (config Config) SetOnlyNewForm() Config
- func (config Config) SetOnlyUpdateForm() Config
- func (config Config) SetPrimaryKey(name string, typ db.DatabaseType) 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(ctx *context.Context, params parameter.Parameters) (PanelInfo, error)
- func (tb *DefaultTable) GetDataWithId(param parameter.Parameters) (FormInfo, error)
- func (tb *DefaultTable) GetDataWithIds(ctx *context.Context, params parameter.Parameters) (PanelInfo, error)
- func (tb *DefaultTable) GetNewFormInfo() FormInfo
- func (tb *DefaultTable) InsertData(ctx *context.Context, dataList form.Values) error
- func (tb *DefaultTable) PreProcessValue(dataList form.Values, typ types.PostType) form.Values
- func (tb *DefaultTable) UpdateData(ctx *context.Context, dataList form.Values) error
- type FormInfo
- type Generator
- type GeneratorList
- type GetDataFromURLRes
- type GetDataFun
- type PanelInfo
- type PrimaryKey
- type SystemTable
- func (s *SystemTable) GetGenerateForm(ctx *context.Context) (generateTool Table)
- 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) (roleTable Table)
- func (s *SystemTable) GetSiteTable(ctx *context.Context) (siteTable 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 NewForm *types.FormPanel Detail *types.InfoPanel CanAdd bool Editable bool Deletable bool Exportable bool OnlyInfo bool OnlyDetail bool OnlyNewForm bool OnlyUpdateForm bool PrimaryKey PrimaryKey }
func (*BaseTable) GetActualNewForm ¶ added in v1.2.17
func (*BaseTable) GetDeletable ¶ added in v1.2.5
func (*BaseTable) GetDetailFromInfo ¶ added in v1.2.8
func (*BaseTable) GetEditable ¶ added in v1.2.5
func (*BaseTable) GetExportable ¶ added in v1.2.5
func (*BaseTable) GetNewForm ¶ added in v1.2.17
func (*BaseTable) GetOnlyDetail ¶ added in v1.2.11
func (*BaseTable) GetOnlyInfo ¶ added in v1.2.11
func (*BaseTable) GetOnlyNewForm ¶ added in v1.2.11
func (*BaseTable) GetOnlyUpdateForm ¶ added in v1.2.11
func (*BaseTable) GetPaginator ¶ added in v1.2.5
func (base *BaseTable) GetPaginator(ctx *context.Context, size int, params parameter.Parameters, extraHtml ...template.HTML) types.PaginatorAttribute
func (*BaseTable) GetPrimaryKey ¶ added in v1.2.5
func (base *BaseTable) GetPrimaryKey() PrimaryKey
type Config ¶
type Config struct { Driver string DriverMode string Connection string CanAdd bool Editable bool Deletable bool Exportable bool PrimaryKey PrimaryKey SourceURL string GetDataFun GetDataFun OnlyInfo bool OnlyNewForm bool OnlyUpdateForm bool OnlyDetail bool }
func DefaultConfig ¶
func DefaultConfig() Config
func DefaultConfigWithDriver ¶
func (Config) SetConnection ¶
func (Config) SetDeletable ¶
func (Config) SetDriverMode ¶ added in v1.2.18
func (Config) SetEditable ¶
func (Config) SetExportable ¶
func (Config) SetGetDataFun ¶ added in v1.1.8
func (config Config) SetGetDataFun(fun GetDataFun) Config
func (Config) SetOnlyDetail ¶ added in v1.2.11
func (Config) SetOnlyInfo ¶ added in v1.2.11
func (Config) SetOnlyNewForm ¶ added in v1.2.11
func (Config) SetOnlyUpdateForm ¶ added in v1.2.11
func (Config) SetPrimaryKey ¶ added in v1.2.17
func (config Config) SetPrimaryKey(name string, typ db.DatabaseType) Config
func (Config) SetPrimaryKeyType ¶
func (Config) SetSourceURL ¶ added in v1.1.8
type DefaultTable ¶
type DefaultTable struct { *BaseTable // contains filtered or unexported fields }
DefaultTable is an implementation of table.Table
func (*DefaultTable) Copy ¶ added in v1.1.6
func (tb *DefaultTable) Copy() Table
Copy copy a new table.Table from origin DefaultTable
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(ctx *context.Context, 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(ctx *context.Context, params parameter.Parameters) (PanelInfo, error)
GetDataWithIds query the data set.
func (*DefaultTable) GetNewFormInfo ¶ added in v1.2.17
func (tb *DefaultTable) GetNewFormInfo() FormInfo
func (*DefaultTable) InsertData ¶ added in v1.2.5
InsertData insert data.
func (*DefaultTable) PreProcessValue ¶ added in v1.2.16
func (*DefaultTable) UpdateData ¶ added in v1.2.5
UpdateData update data.
type FormInfo ¶ added in v1.2.5
type FormInfo struct { FieldList types.FormFields `json:"field_list"` GroupFieldList types.GroupFormFields `json:"group_field_list"` GroupFieldHeaders types.GroupFieldHeaders `json:"group_field_headers"` Title string `json:"title"` Description string `json:"description"` }
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(list GeneratorList) GeneratorList
func (GeneratorList) CombineAll ¶ added in v1.1.6
func (g GeneratorList) CombineAll(gens []GeneratorList) GeneratorList
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 `json:"thead"` InfoList types.InfoList `json:"info_list"` FilterFormData types.FormFields `json:"filter_form_data"` Paginator types.PaginatorAttribute `json:"-"` Title string `json:"title"` Description string `json:"description"` }
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, c *config.Config) *SystemTable
func (*SystemTable) GetGenerateForm ¶ added in v1.2.11
func (s *SystemTable) GetGenerateForm(ctx *context.Context) (generateTool Table)
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) (roleTable Table)
func (*SystemTable) GetSiteTable ¶ added in v1.2.8
func (s *SystemTable) GetSiteTable(ctx *context.Context) (siteTable Table)
type Table ¶
type Table interface { GetInfo() *types.InfoPanel GetDetail() *types.InfoPanel GetDetailFromInfo() *types.InfoPanel GetForm() *types.FormPanel GetNewForm() *types.FormPanel GetActualNewForm() *types.FormPanel GetCanAdd() bool GetEditable() bool GetDeletable() bool GetExportable() bool GetPrimaryKey() PrimaryKey GetData(ctx *context.Context, params parameter.Parameters) (PanelInfo, error) GetDataWithIds(ctx *context.Context, params parameter.Parameters) (PanelInfo, error) GetDataWithId(params parameter.Parameters) (FormInfo, error) UpdateData(ctx *context.Context, dataList form.Values) error InsertData(ctx *context.Context, ddataList form.Values) error DeleteData(pk string) error GetNewFormInfo() FormInfo GetOnlyInfo() bool GetOnlyDetail() bool GetOnlyNewForm() bool GetOnlyUpdateForm() bool Copy() Table }
Click to show internal directories.
Click to hide internal directories.