go-admin: github.com/GoAdminGroup/go-admin/plugins/admin/modules/table Index | Files

package table

import "github.com/GoAdminGroup/go-admin/plugins/admin/modules/table"


Package Files

generators.go table.go


const (
    DefaultPrimaryKeyName = "id"
    DefaultConnectionName = "default"

func GetNewFormList Uses

func GetNewFormList(groupHeaders []string,
    group [][]string,
    old []types.FormField) ([]types.FormField, [][]types.FormField, []string)

func InitTableList Uses

func InitTableList()

func RefreshTableList Uses

func RefreshTableList()

RefreshTableList refresh the table list when the table relationship changed.

func SetGenerators Uses

func SetGenerators(gens map[string]Generator)

SetGenerators update generators.

func SetServices Uses

func SetServices(srv service.List)

type Columns Uses

type Columns []string

type Config Uses

type Config struct {
    Driver     string
    Connection string
    CanAdd     bool
    Editable   bool
    Deletable  bool
    Exportable bool
    PrimaryKey PrimaryKey
    SourceURL  string
    GetDataFun GetDataFun

func DefaultConfig Uses

func DefaultConfig() Config

func DefaultConfigWithDriver Uses

func DefaultConfigWithDriver(driver string) Config

func DefaultConfigWithDriverAndConnection Uses

func DefaultConfigWithDriverAndConnection(driver, conn string) Config

func (Config) SetCanAdd Uses

func (config Config) SetCanAdd(canAdd bool) Config

func (Config) SetConnection Uses

func (config Config) SetConnection(connection string) Config

func (Config) SetDeletable Uses

func (config Config) SetDeletable(deletable bool) Config

func (Config) SetEditable Uses

func (config Config) SetEditable(editable bool) Config

func (Config) SetExportable Uses

func (config Config) SetExportable(exportable bool) Config

func (Config) SetGetDataFun Uses

func (config Config) SetGetDataFun(fun GetDataFun) Config

func (Config) SetPrimaryKeyType Uses

func (config Config) SetPrimaryKeyType(typ string) Config

func (Config) SetSourceURL Uses

func (config Config) SetSourceURL(url string) Config

type DefaultTable Uses

type DefaultTable struct {
    // contains filtered or unexported fields

func (DefaultTable) Copy Uses

func (tb DefaultTable) Copy() Table

func (DefaultTable) DeleteDataFromDatabase Uses

func (tb DefaultTable) DeleteDataFromDatabase(id string) error

DeleteDataFromDatabase delete data.

func (DefaultTable) GetCanAdd Uses

func (tb DefaultTable) GetCanAdd() bool

func (DefaultTable) GetData Uses

func (tb DefaultTable) GetData(path string, params parameter.Parameters, isAll bool) (PanelInfo, error)

GetData query the data set.

func (DefaultTable) GetDataWithId Uses

func (tb DefaultTable) GetDataWithId(id string) ([]types.FormField, [][]types.FormField, []string, string, string, error)

GetDataWithId query the single row of data.

func (DefaultTable) GetDataWithIds Uses

func (tb DefaultTable) GetDataWithIds(path string, params parameter.Parameters, ids []string) (PanelInfo, error)

GetDataWithIds query the data set.

func (DefaultTable) GetDeletable Uses

func (tb DefaultTable) GetDeletable() bool

func (DefaultTable) GetDetail Uses

func (tb DefaultTable) GetDetail() *types.InfoPanel

func (DefaultTable) GetEditable Uses

func (tb DefaultTable) GetEditable() bool

func (DefaultTable) GetExportable Uses

func (tb DefaultTable) GetExportable() bool

func (DefaultTable) GetForm Uses

func (tb DefaultTable) GetForm() *types.FormPanel

func (DefaultTable) GetInfo Uses

func (tb DefaultTable) GetInfo() *types.InfoPanel

func (DefaultTable) GetPrimaryKey Uses

func (tb DefaultTable) GetPrimaryKey() PrimaryKey

func (DefaultTable) InsertDataFromDatabase Uses

func (tb DefaultTable) InsertDataFromDatabase(dataList form.Values) error

InsertDataFromDatabase insert data.

func (DefaultTable) IsShowDetail Uses

func (tb DefaultTable) IsShowDetail() bool

func (DefaultTable) UpdateDataFromDatabase Uses

func (tb DefaultTable) UpdateDataFromDatabase(dataList form.Values) error

UpdateDataFromDatabase update data.

type Generator Uses

type Generator func() Table

type GeneratorList Uses

type GeneratorList map[string]Generator

func (GeneratorList) Add Uses

func (g GeneratorList) Add(key string, gen Generator)

func (GeneratorList) Combine Uses

func (g GeneratorList) Combine(gg GeneratorList)

func (GeneratorList) CombineAll Uses

func (g GeneratorList) CombineAll(ggg []GeneratorList)

func (GeneratorList) InjectRoutes Uses

func (g GeneratorList) InjectRoutes(app *context.App)

type GetDataFromURLRes Uses

type GetDataFromURLRes struct {
    Data InfoList
    Size int

type GetDataFun Uses

type GetDataFun func(path string, params parameter.Parameters, isAll bool, ids []string) (InfoList, int)

type InfoList Uses

type InfoList []map[string]template.HTML

func (InfoList) GroupBy Uses

func (i InfoList) GroupBy(groups types.TabGroups) []InfoList

type PanelInfo Uses

type PanelInfo struct {
    Thead       Thead
    InfoList    InfoList
    FormData    []types.FormField
    Paginator   types.PaginatorAttribute
    Title       string
    Description string

type PrimaryKey Uses

type PrimaryKey struct {
    Type db.DatabaseType
    Name string

type Table Uses

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 Get Uses

func Get(key string) Table

func GetManagerTable Uses

func GetManagerTable() (ManagerTable Table)

func GetMenuTable Uses

func GetMenuTable() (MenuTable Table)

func GetNormalManagerTable Uses

func GetNormalManagerTable() (ManagerTable Table)

func GetOpTable Uses

func GetOpTable() (OpTable Table)

func GetPermissionTable Uses

func GetPermissionTable() (PermissionTable Table)

func GetRolesTable Uses

func GetRolesTable() (RolesTable Table)

func NewDefaultTable Uses

func NewDefaultTable(cfg Config) Table

type Thead Uses

type Thead []map[string]string

func (Thead) GroupBy Uses

func (t Thead) GroupBy(group [][]string) []Thead

Package table imports 27 packages (graph) and is imported by 8 packages. Updated 2020-01-23. Refresh now. Tools for package owners.