Documentation ¶
Index ¶
- Constants
- func GetNewFormList(groupHeaders []string, group [][]string, old []types.FormField) ([]types.FormField, [][]types.FormField, []string)
- func InitTableList()
- func RefreshTableList()
- func SetGenerators(gens map[string]Generator)
- func SetServices(srv service.List)
- 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) DeleteDataFromDatabase(id string) error
- func (tb DefaultTable) GetCanAdd() bool
- func (tb DefaultTable) GetData(path string, params parameter.Parameters, isAll bool) (PanelInfo, error)
- func (tb DefaultTable) GetDataWithId(id string) ([]types.FormField, [][]types.FormField, []string, string, string, error)
- func (tb DefaultTable) GetDataWithIds(path string, params parameter.Parameters, ids []string) (PanelInfo, error)
- func (tb DefaultTable) GetDeletable() bool
- func (tb DefaultTable) GetDetail() *types.InfoPanel
- func (tb DefaultTable) GetEditable() bool
- func (tb DefaultTable) GetExportable() bool
- func (tb DefaultTable) GetForm() *types.FormPanel
- func (tb DefaultTable) GetInfo() *types.InfoPanel
- func (tb DefaultTable) GetPrimaryKey() PrimaryKey
- func (tb DefaultTable) InsertDataFromDatabase(dataList form.Values) error
- func (tb DefaultTable) IsShowDetail() bool
- func (tb DefaultTable) UpdateDataFromDatabase(dataList form.Values) error
- type Generator
- type GeneratorList
- type GetDataFromURLRes
- type GetDataFun
- type InfoList
- type PanelInfo
- type PrimaryKey
- type Table
- func Get(key string) Table
- func GetManagerTable() (ManagerTable Table)
- func GetMenuTable() (MenuTable Table)
- func GetNormalManagerTable() (ManagerTable Table)
- func GetOpTable() (OpTable Table)
- func GetPermissionTable() (PermissionTable Table)
- func GetRolesTable() (RolesTable Table)
- func NewDefaultTable(cfg Config) Table
- type Thead
Constants ¶
View Source
const ( DefaultPrimaryKeyName = "id" DefaultConnectionName = "default" )
Variables ¶
This section is empty.
Functions ¶
func GetNewFormList ¶
func InitTableList ¶
func InitTableList()
func RefreshTableList ¶
func RefreshTableList()
RefreshTableList refresh the table list when the table relationship changed.
func SetServices ¶ added in v1.1.2
Types ¶
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 {
// contains filtered or unexported fields
}
func (DefaultTable) Copy ¶ added in v1.1.6
func (tb DefaultTable) Copy() Table
func (DefaultTable) DeleteDataFromDatabase ¶
func (tb DefaultTable) DeleteDataFromDatabase(id string) error
DeleteDataFromDatabase delete data.
func (DefaultTable) GetCanAdd ¶
func (tb DefaultTable) GetCanAdd() bool
func (DefaultTable) GetData ¶ added in v1.1.8
func (tb DefaultTable) GetData(path string, params parameter.Parameters, isAll bool) (PanelInfo, error)
GetData query the data set.
func (DefaultTable) GetDataWithId ¶ added in v1.1.8
func (tb DefaultTable) GetDataWithId(id string) ([]types.FormField, [][]types.FormField, []string, string, string, error)
GetDataWithId query the single row of data.
func (DefaultTable) GetDataWithIds ¶ added in v1.1.8
func (tb DefaultTable) GetDataWithIds(path string, params parameter.Parameters, ids []string) (PanelInfo, error)
GetDataWithIds query the data set.
func (DefaultTable) GetDeletable ¶
func (tb DefaultTable) GetDeletable() bool
func (DefaultTable) GetDetail ¶ added in v1.1.7
func (tb DefaultTable) GetDetail() *types.InfoPanel
func (DefaultTable) GetEditable ¶
func (tb DefaultTable) GetEditable() bool
func (DefaultTable) GetExportable ¶
func (tb DefaultTable) GetExportable() bool
func (DefaultTable) GetForm ¶
func (tb DefaultTable) GetForm() *types.FormPanel
func (DefaultTable) GetInfo ¶
func (tb DefaultTable) GetInfo() *types.InfoPanel
func (DefaultTable) GetPrimaryKey ¶
func (tb DefaultTable) GetPrimaryKey() PrimaryKey
func (DefaultTable) InsertDataFromDatabase ¶
func (tb DefaultTable) InsertDataFromDatabase(dataList form.Values) error
InsertDataFromDatabase insert data.
func (DefaultTable) IsShowDetail ¶ added in v1.1.7
func (tb DefaultTable) IsShowDetail() bool
func (DefaultTable) UpdateDataFromDatabase ¶
func (tb DefaultTable) UpdateDataFromDatabase(dataList form.Values) error
UpdateDataFromDatabase update data.
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)
func (GeneratorList) CombineAll ¶ added in v1.1.6
func (g GeneratorList) CombineAll(ggg []GeneratorList)
func (GeneratorList) InjectRoutes ¶ added in v1.1.8
func (g GeneratorList) InjectRoutes(app *context.App)
type GetDataFromURLRes ¶ added in v1.1.8
type GetDataFun ¶ added in v1.1.8
type PrimaryKey ¶
type PrimaryKey struct { Type db.DatabaseType Name string }
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(path string, params parameter.Parameters, isAll bool) (PanelInfo, error) GetDataWithIds(path string, params parameter.Parameters, ids []string) (PanelInfo, error) GetDataWithId(id string) ([]types.FormField, [][]types.FormField, []string, string, string, error) UpdateDataFromDatabase(dataList form.Values) error InsertDataFromDatabase(dataList form.Values) error DeleteDataFromDatabase(id string) error Copy() Table }
func GetManagerTable ¶
func GetManagerTable() (ManagerTable Table)
func GetMenuTable ¶
func GetMenuTable() (MenuTable Table)
func GetNormalManagerTable ¶ added in v1.1.5
func GetNormalManagerTable() (ManagerTable Table)
func GetOpTable ¶
func GetOpTable() (OpTable Table)
func GetPermissionTable ¶
func GetPermissionTable() (PermissionTable Table)
func GetRolesTable ¶
func GetRolesTable() (RolesTable Table)
func NewDefaultTable ¶
Click to show internal directories.
Click to hide internal directories.