{"modulePath":"github.com/GoAdminLive/go-admin","version":"v0.1.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package table\n\n## Constants\n\n```go\nconst (\n\tDefaultPrimaryKeyName = \"id\"\n\tDefaultConnectionName = \"default\"\n)\n```\n\n## Functions\n\n```go\nfunc SetServices(srv service.List)\n```\n\n## Types\n\n```go\ntype BaseTable struct {\n\tInfo           *types.InfoPanel\n\tForm           *types.FormPanel\n\tNewForm        *types.FormPanel\n\tDetail         *types.InfoPanel\n\tCanAdd         bool\n\tEditable       bool\n\tDeletable      bool\n\tExportable     bool\n\tOnlyInfo       bool\n\tOnlyDetail     bool\n\tOnlyNewForm    bool\n\tOnlyUpdateForm bool\n\tPrimaryKey     PrimaryKey\n}\n```\n\n```go\nfunc (base *BaseTable) GetActualNewForm() *types.FormPanel\n```\n\n```go\nfunc (base *BaseTable) GetCanAdd() bool\n```\n\n```go\nfunc (base *BaseTable) GetDeletable() bool\n```\n\n```go\nfunc (base *BaseTable) GetDetail() *types.InfoPanel\n```\n\n```go\nfunc (base *BaseTable) GetDetailFromInfo() *types.InfoPanel\n```\n\n```go\nfunc (base *BaseTable) GetEditable() bool\n```\n\n```go\nfunc (base *BaseTable) GetExportable() bool\n```\n\n```go\nfunc (base *BaseTable) GetForm() *types.FormPanel\n```\n\n```go\nfunc (base *BaseTable) GetInfo() *types.InfoPanel\n```\n\n```go\nfunc (base *BaseTable) GetNewForm() *types.FormPanel\n```\n\n```go\nfunc (base *BaseTable) GetOnlyDetail() bool\n```\n\n```go\nfunc (base *BaseTable) GetOnlyInfo() bool\n```\n\n```go\nfunc (base *BaseTable) GetOnlyNewForm() bool\n```\n\n```go\nfunc (base *BaseTable) GetOnlyUpdateForm() bool\n```\n\n```go\nfunc (base *BaseTable) GetPaginator(\n\tctx *context.Context, size int, params parameter.Parameters, extraHtml ...template.HTML,\n) types.PaginatorAttribute\n```\n\n```go\nfunc (base *BaseTable) GetPrimaryKey() PrimaryKey\n```\n\n```go\ntype Columns []string\n```\n\n```go\ntype Config struct {\n\tDriver         string\n\tDriverMode     string\n\tConnection     string\n\tCanAdd         bool\n\tEditable       bool\n\tDeletable      bool\n\tExportable     bool\n\tPrimaryKey     PrimaryKey\n\tSourceURL      string\n\tGetDataFun     GetDataFun\n\tOnlyInfo       bool\n\tOnlyNewForm    bool\n\tOnlyUpdateForm bool\n\tOnlyDetail     bool\n}\n```\n\n```go\nfunc DefaultConfig() Config\n```\n\n```go\nfunc DefaultConfigWithDriver(driver string) Config\n```\n\n```go\nfunc DefaultConfigWithDriverAndConnection(driver, conn string) Config\n```\n\n```go\nfunc (config Config) SetCanAdd(canAdd bool) Config\n```\n\n```go\nfunc (config Config) SetConnection(connection string) Config\n```\n\n```go\nfunc (config Config) SetDeletable(deletable bool) Config\n```\n\n```go\nfunc (config Config) SetDriverMode(mode string) Config\n```\n\n```go\nfunc (config Config) SetEditable(editable bool) Config\n```\n\n```go\nfunc (config Config) SetExportable(exportable bool) Config\n```\n\n```go\nfunc (config Config) SetGetDataFun(fun GetDataFun) Config\n```\n\n```go\nfunc (config Config) SetOnlyDetail() Config\n```\n\n```go\nfunc (config Config) SetOnlyInfo() Config\n```\n\n```go\nfunc (config Config) SetOnlyNewForm() Config\n```\n\n```go\nfunc (config Config) SetOnlyUpdateForm() Config\n```\n\n```go\nfunc (config Config) SetPrimaryKey(name string, typ db.DatabaseType) Config\n```\n\n```go\nfunc (config Config) SetPrimaryKeyType(typ string) Config\n```\n\n```go\nfunc (config Config) SetSourceURL(url string) Config\n```\n\n```go\ntype DefaultTable struct {\n\t*BaseTable\n\t// contains filtered or unexported fields\n}\n```\nDefaultTable is an implementation of table.Table\n\n```go\nfunc (tb *DefaultTable) Copy() Table\n```\nCopy copy a new table.Table from origin DefaultTable\n\n```go\nfunc (tb *DefaultTable) DeleteData(id string) error\n```\nDeleteData delete data.\n\n```go\nfunc (tb *DefaultTable) GetData(ctx *context.Context, params parameter.Parameters) (PanelInfo, error)\n```\nGetData query the data set.\n\n```go\nfunc (tb *DefaultTable) GetDataWithId(param parameter.Parameters) (FormInfo, error)\n```\nGetDataWithId query the single row of data.\n\n```go\nfunc (tb *DefaultTable) GetDataWithIds(ctx *context.Context, params parameter.Parameters) (PanelInfo, error)\n```\nGetDataWithIds query the data set.\n\n```go\nfunc (tb *DefaultTable) GetNewFormInfo() FormInfo\n```\n\n```go\nfunc (tb *DefaultTable) InsertData(ctx *context.Context, dataList form.Values) error\n```\nInsertData insert data.\n\n```go\nfunc (tb *DefaultTable) PreProcessValue(dataList form.Values, typ types.PostType) form.Values\n```\n\n```go\nfunc (tb *DefaultTable) UpdateData(ctx *context.Context, dataList form.Values) error\n```\nUpdateData update data.\n\n```go\ntype FormInfo struct {\n\tFieldList         types.FormFields        `json:\"field_list\"`\n\tGroupFieldList    types.GroupFormFields   `json:\"group_field_list\"`\n\tGroupFieldHeaders types.GroupFieldHeaders `json:\"group_field_headers\"`\n\tTitle             string                  `json:\"title\"`\n\tDescription       string                  `json:\"description\"`\n}\n```\n\n```go\ntype Generator func(ctx *context.Context) Table\n```\n\n```go\ntype GeneratorList map[string]Generator\n```\n\n```go\nfunc (g GeneratorList) Add(key string, gen Generator)\n```\n\n```go\nfunc (g GeneratorList) Combine(list GeneratorList) GeneratorList\n```\n\n```go\nfunc (g GeneratorList) CombineAll(gens []GeneratorList) GeneratorList\n```\n\n```go\ntype GetDataFromURLRes struct {\n\tData []map[string]interface{}\n\tSize int\n}\n```\n\n```go\ntype GetDataFun func(params parameter.Parameters) ([]map[string]interface{}, int)\n```\n\n```go\ntype PanelInfo struct {\n\tThead          types.Thead              `json:\"thead\"`\n\tInfoList       types.InfoList           `json:\"info_list\"`\n\tFilterFormData types.FormFields         `json:\"filter_form_data\"`\n\tPaginator      types.PaginatorAttribute `json:\"-\"`\n\tTitle          string                   `json:\"title\"`\n\tDescription    string                   `json:\"description\"`\n}\n```\n\n```go\ntype PrimaryKey struct {\n\tType db.DatabaseType\n\tName string\n}\n```\n\n```go\ntype SystemTable struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewSystemTable(conn db.Connection, c *config.Config) *SystemTable\n```\n\n```go\nfunc (s *SystemTable) GetGenerateForm(ctx *context.Context) (generateTool Table)\n```\n\n```go\nfunc (s *SystemTable) GetManagerTable(ctx *context.Context) (managerTable Table)\n```\n\n```go\nfunc (s *SystemTable) GetMenuTable(ctx *context.Context) (menuTable Table)\n```\n\n```go\nfunc (s *SystemTable) GetNormalManagerTable(ctx *context.Context) (managerTable Table)\n```\n\n```go\nfunc (s *SystemTable) GetOpTable(ctx *context.Context) (opTable Table)\n```\n\n```go\nfunc (s *SystemTable) GetPermissionTable(ctx *context.Context) (permissionTable Table)\n```\n\n```go\nfunc (s *SystemTable) GetRolesTable(ctx *context.Context) (roleTable Table)\n```\n\n```go\nfunc (s *SystemTable) GetSiteTable(ctx *context.Context) (siteTable Table)\n```\n\n```go\ntype Table interface {\n\tGetInfo() *types.InfoPanel\n\tGetDetail() *types.InfoPanel\n\tGetDetailFromInfo() *types.InfoPanel\n\tGetForm() *types.FormPanel\n\tGetNewForm() *types.FormPanel\n\tGetActualNewForm() *types.FormPanel\n\n\tGetCanAdd() bool\n\tGetEditable() bool\n\tGetDeletable() bool\n\tGetExportable() bool\n\n\tGetPrimaryKey() PrimaryKey\n\n\tGetData(ctx *context.Context, params parameter.Parameters) (PanelInfo, error)\n\tGetDataWithIds(ctx *context.Context, params parameter.Parameters) (PanelInfo, error)\n\tGetDataWithId(params parameter.Parameters) (FormInfo, error)\n\tUpdateData(ctx *context.Context, dataList form.Values) error\n\tInsertData(ctx *context.Context, ddataList form.Values) error\n\tDeleteData(pk string) error\n\n\tGetNewFormInfo() FormInfo\n\n\tGetOnlyInfo() bool\n\tGetOnlyDetail() bool\n\tGetOnlyNewForm() bool\n\tGetOnlyUpdateForm() bool\n\n\tCopy() Table\n}\n```\n\n```go\nfunc NewDefaultTable(ctx *context.Context, cfgs ...Config) Table\n```\n\n","path":"github.com/GoAdminLive/go-admin/plugins/admin/modules/table","name":"table","synopsis":"","isRedistributable":true}
