models

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2019 License: MIT Imports: 14 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 GetDefault added in v0.0.4

func GetDefault(values url.Values, key, def string) string

func GetNewFormList

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

func GetPaginator

func GetPaginator(path string, params *Parameters, 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 PanelInfo added in v0.0.4

type PanelInfo struct {
	Thead       []map[string]string
	InfoList    []map[string]template.HTML
	Paginator   types.PaginatorAttribute
	Title       string
	Description string
}

type Parameters added in v0.0.4

type Parameters struct {
	Page      string
	PageSize  string
	SortField string
	SortType  string
	Fields    map[string]string
}

func GetParam added in v0.0.4

func GetParam(values url.Values) *Parameters

func GetParamFromUrl added in v0.0.4

func GetParamFromUrl(value string) *Parameters

func (*Parameters) GetFixedParamStr added in v0.0.4

func (param *Parameters) GetFixedParamStr() string

func (*Parameters) GetFixedParamStrWithoutPageSize added in v0.0.4

func (param *Parameters) GetFixedParamStrWithoutPageSize() string

func (*Parameters) GetLastPageRouteParamStr added in v0.0.4

func (param *Parameters) GetLastPageRouteParamStr() string

func (*Parameters) GetNextPageRouteParamStr added in v0.0.4

func (param *Parameters) GetNextPageRouteParamStr() string

func (*Parameters) GetRouteParamStr added in v0.0.4

func (param *Parameters) GetRouteParamStr() string

func (*Parameters) GetRouteParamStrWithoutPageSize added in v0.0.4

func (param *Parameters) GetRouteParamStrWithoutPageSize() string

func (*Parameters) SetPage added in v0.0.4

func (param *Parameters) SetPage(page string) *Parameters

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 (tb Table) DeleteDataFromDatabase(id string)

DeleteDataFromDatabase delete data.

func (Table) GetDataFromDatabase

func (tb Table) GetDataFromDatabase(path string, params *Parameters) PanelInfo

GetDataFromDatabase query the data set.

func (Table) GetDataFromDatabaseWithId

func (tb Table) GetDataFromDatabaseWithId(id string) ([]types.Form, string, string)

GetDataFromDatabaseWithId query the single row of data.

func (Table) GetFiltersMap added in v0.0.4

func (tb Table) GetFiltersMap() []map[string]string

func (Table) InsertDataFromDatabase

func (tb Table) InsertDataFromDatabase(dataList map[string][]string)

InsertDataFromDatabase insert data.

func (Table) UpdateDataFromDatabase

func (tb Table) UpdateDataFromDatabase(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