Versions in this module Expand all Collapse all v1 v1.3.1 Sep 5, 2020 v1.3.0 Sep 5, 2020 Changes in this version + const SiteItemOffState + const SiteItemOpenState + type Base struct + Conn db.Connection + TableName string + Tx *sql.Tx + func (b Base) SetConn(con db.Connection) Base + func (b Base) Table(table string) *db.SQL + type MenuModel struct + CreatedAt string + Header string + Icon string + Id int64 + ParentId int64 + Title string + UpdatedAt string + Uri string + func Menu() MenuModel + func MenuWithId(id string) MenuModel + func (t MenuModel) AddRole(roleId string) (int64, error) + func (t MenuModel) CheckRole(roleId string) bool + func (t MenuModel) Delete() + func (t MenuModel) DeleteRoles() error + func (t MenuModel) Find(id interface{}) MenuModel + func (t MenuModel) MapToModel(m map[string]interface{}) MenuModel + func (t MenuModel) New(title, icon, uri, header, pluginName string, parentId, order int64) (MenuModel, error) + func (t MenuModel) ResetOrder(data []byte) + func (t MenuModel) SetConn(con db.Connection) MenuModel + func (t MenuModel) Update(title, icon, uri, header, pluginName string, parentId int64) (int64, error) + type OperationLogModel struct + CreatedAt string + Id int64 + Input string + Ip string + Method string + Path string + UpdatedAt string + UserId int64 + func OperationLog() OperationLogModel + func (t OperationLogModel) Find(id interface{}) OperationLogModel + func (t OperationLogModel) MapToModel(m map[string]interface{}) OperationLogModel + func (t OperationLogModel) New(userId int64, path, method, ip, input string) OperationLogModel + func (t OperationLogModel) SetConn(con db.Connection) OperationLogModel + type OrderItem struct + Children OrderItems + ID uint + type OrderItems []OrderItem + type PermissionModel struct + CreatedAt string + HttpMethod []string + HttpPath []string + Id int64 + Name string + Slug string + UpdatedAt string + func Permission() PermissionModel + func PermissionWithId(id string) PermissionModel + func (t PermissionModel) Find(id interface{}) PermissionModel + func (t PermissionModel) FindByName(name string) PermissionModel + func (t PermissionModel) FindBySlug(slug string) PermissionModel + func (t PermissionModel) IsEmpty() bool + func (t PermissionModel) IsSlugExist(slug string, id string) bool + func (t PermissionModel) MapToModel(m map[string]interface{}) PermissionModel + func (t PermissionModel) SetConn(con db.Connection) PermissionModel + type RoleModel struct + CreatedAt string + Id int64 + Name string + Slug string + UpdatedAt string + func Role() RoleModel + func RoleWithId(id string) RoleModel + func (t RoleModel) AddPermission(permissionId string) (int64, error) + func (t RoleModel) CheckPermission(permissionId string) bool + func (t RoleModel) DeletePermissions() error + func (t RoleModel) Find(id interface{}) RoleModel + func (t RoleModel) IsSlugExist(slug string, id string) bool + func (t RoleModel) MapToModel(m map[string]interface{}) RoleModel + func (t RoleModel) New(name, slug string) (RoleModel, error) + func (t RoleModel) SetConn(con db.Connection) RoleModel + func (t RoleModel) Update(name, slug string) (int64, error) + func (t RoleModel) WithTx(tx *sql.Tx) RoleModel + type SiteModel struct + CreatedAt string + Desc string + Id int64 + Key string + State int64 + UpdatedAt string + Value string + func Site() SiteModel + func (t SiteModel) AllToMap() map[string]string + func (t SiteModel) AllToMapInterface() map[string]interface{} + func (t SiteModel) Init(cfg map[string]string) SiteModel + func (t SiteModel) SetConn(con db.Connection) SiteModel + func (t SiteModel) Update(v form.Values) error + func (t SiteModel) WithTx(tx *sql.Tx) SiteModel + type UserModel struct + Avatar string + CreatedAt string + Id int64 + Level string + LevelName string + MenuIds []int64 + Name string + Password string + Permissions []PermissionModel + RememberToken string + Roles []RoleModel + UpdatedAt string + UserName string + func User() UserModel + func UserWithId(id string) UserModel + func (t UserModel) AddPermission(permissionId string) (int64, error) + func (t UserModel) AddRole(roleId string) (int64, error) + func (t UserModel) CheckPermission(permission string) bool + func (t UserModel) CheckPermissionById(permissionId string) bool + func (t UserModel) CheckPermissionByUrlMethod(path, method string, formParams url.Values) bool + func (t UserModel) CheckRole(slug string) bool + func (t UserModel) CheckRoleId(roleId string) bool + func (t UserModel) DeletePermissions() error + func (t UserModel) DeleteRoles() error + func (t UserModel) Find(id interface{}) UserModel + func (t UserModel) FindByUserName(username interface{}) UserModel + func (t UserModel) GetAllRoleId() []interface{} + func (t UserModel) GetCheckPermissionByUrlMethod(path, method string) string + func (t UserModel) HasMenu() bool + func (t UserModel) HideUserCenterEntrance() bool + func (t UserModel) IsEmpty() bool + func (t UserModel) IsSuperAdmin() bool + func (t UserModel) IsVisitor() bool + func (t UserModel) MapToModel(m map[string]interface{}) UserModel + func (t UserModel) New(username, password, name, avatar string) (UserModel, error) + func (t UserModel) ReleaseConn() UserModel + func (t UserModel) SetConn(con db.Connection) UserModel + func (t UserModel) Template(str string) string + func (t UserModel) Update(username, password, name, avatar string) (int64, error) + func (t UserModel) UpdateAvatar(avatar string) + func (t UserModel) UpdatePwd(password string) UserModel + func (t UserModel) WithMenus() UserModel + func (t UserModel) WithPermissions() UserModel + func (t UserModel) WithRoles() UserModel + func (t UserModel) WithTx(tx *sql.Tx) UserModel v0 v0.0.2 Sep 19, 2018 Changes in this version + var Generators = map[string]TableGenerator + var TableList = map[string]Table + func CheckInTable(columns []string, find string) bool + func GetNewFormList(old []types.FormStruct) []types.FormStruct + func GetPaginator(path string, pageInt int, page, pageSize, sortField, sortType string, size int) types.PaginatorAttribute + func GetStringFromType(typeName string, value interface{}) string + func InitTableList() + func RefreshTableList() + func SetGenerators(generators map[string]TableGenerator) + type Columns []string + func GetColumns(columnsModel []map[string]interface{}, driver string) Columns + type Table struct + ConnectionDriver string + Form types.FormPanel + Info types.InfoPanel + func GetManagerTable() (ManagerTable Table) + func GetMenuTable() (MenuTable Table) + func GetOpTable() (OpTable Table) + func GetPermissionTable() (PermissionTable Table) + func GetRolesTable() (RolesTable Table) + func (tableModel Table) DeleteDataFromDatabase(prefix string, id string) + func (tableModel Table) GetDataFromDatabase(queryParam map[string]string) ([]map[string]string, []map[string]template.HTML, types.PaginatorAttribute, ...) + func (tableModel Table) GetDataFromDatabaseWithId(prefix string, id string) ([]types.FormStruct, string, string) + func (tableModel Table) InsertDataFromDatabase(prefix string, dataList map[string][]string) + func (tableModel Table) UpdateDataFromDatabase(prefix string, dataList map[string][]string) + type TableGenerator func() Table