models

package
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 19, 2018 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Generators = map[string]TableGenerator{}
	TableList  = map[string]Table{}
)

Functions

func CheckInTable

func CheckInTable(columns []string, find string) bool

CheckInTable checks the find string is in the columns or not.

func GetNewFormList

func GetNewFormList(old []types.FormStruct) []types.FormStruct

func GetPaginator

func GetPaginator(path string, pageInt int, page, pageSize, sortField, sortType string, size int) types.PaginatorAttribute

func GetStringFromType

func GetStringFromType(typeName string, value interface{}) string

func InitTableList

func InitTableList()

func RefreshTableList

func RefreshTableList()

RefreshTableList refresh the table list when the table relationship changed.

func SetGenerators

func SetGenerators(generators map[string]TableGenerator)

Types

type Columns

type Columns []string

func GetColumns

func GetColumns(columnsModel []map[string]interface{}, driver string) Columns

type Table

type Table struct {
	Info             types.InfoPanel
	Form             types.FormPanel
	ConnectionDriver string
}

func GetManagerTable

func GetManagerTable() (ManagerTable Table)

func GetMenuTable

func GetMenuTable() (MenuTable Table)

func GetOpTable

func GetOpTable() (OpTable Table)

func GetPermissionTable

func GetPermissionTable() (PermissionTable Table)

func GetRolesTable

func GetRolesTable() (RolesTable Table)

func (Table) DeleteDataFromDatabase

func (tableModel Table) DeleteDataFromDatabase(prefix string, id string)

DeleteDataFromDatabase delete data.

func (Table) GetDataFromDatabase

func (tableModel Table) GetDataFromDatabase(queryParam map[string]string) ([]map[string]string, []map[string]template.HTML, types.PaginatorAttribute, string, string)

GetDataFromDatabase query the data set.

func (Table) GetDataFromDatabaseWithId

func (tableModel Table) GetDataFromDatabaseWithId(prefix string, id string) ([]types.FormStruct, string, string)

GetDataFromDatabaseWithId query the single row of data.

func (Table) InsertDataFromDatabase

func (tableModel Table) InsertDataFromDatabase(prefix string, dataList map[string][]string)

InsertDataFromDatabase insert data.

func (Table) UpdateDataFromDatabase

func (tableModel Table) UpdateDataFromDatabase(prefix string, dataList map[string][]string)

UpdateDataFromDatabase update data.

type TableGenerator

type TableGenerator func() Table

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL