Versions in this module Expand all Collapse all v0 v0.2.0 Jan 31, 2024 Changes in this version + func InitTenant(tx *gorm.DB) error + func MenuTransferToTreeSlice(list []*Menu) []pkg.TreeImp + func PasswordReset(ctx context.Context, userID string, password string) error + func SaveAPI(routes gin.RoutesInfo) error + func SortMenu(tree MenuList) + func TaskOnce(id string) error + func TenantIDScope(ctx *gin.Context) (any, error) + type API struct + Handler string + History bool + Method string + Name string + Path string + func (*API) TableName() string + type AdminUser struct + Email string + Password string + Username string + type AppConfig struct + Group string + Name string + Value string + func (*AppConfig) TableName() string + func (e *AppConfig) GetAppConfig(ctx *gin.Context, key string) (string, bool) + func (e *AppConfig) SetAppConfig(ctx *gin.Context, key string, value string) error + type ArrayString []string + func (a *ArrayString) Scan(val any) error + func (a *ArrayString) Value() (driver.Value, error) + type CasbinRule struct + ID int + PType string + V0 string + V1 string + V2 string + V3 string + V4 string + V5 string + func (*CasbinRule) TableName() string + type DataScope string + const DataScopeAll + const DataScopeCurrentAndChildrenDept + const DataScopeCurrentDept + const DataScopeCustomDept + const DataScopeSelf + const DataScopeSelfAndAllChildren + const DataScopeSelfAndChildren + type Department struct + Children []*Department + Code string + Email string + LeaderID string + Name string + ParentID string + Phone string + Sort int + Status enum.Status + func (*Department) TableName() string + func (e *Department) AddChildren(children []pkg.TreeImp) + func (e *Department) GetAllChildrenID(tx *gorm.DB) []string + func (e *Department) GetIndex() string + func (e *Department) GetParentID() string + func (e *Department) SortChildren() + type DepartmentList []*Department + func (x DepartmentList) Len() int + func (x DepartmentList) Less(i, j int) bool + func (x DepartmentList) Swap(i, j int) + type Field struct + AssociationsID string + Comment string + Default string + Index string + JsonTag string + Label string + ModelID string + Name string + NotNull bool + PrimaryKey string + Search string + Size int + Sort uint + Type string + UniqueIndex string + ValueEnumName string + func (*Field) TableName() string + func (e *Field) BeforeSave(_ *gorm.DB) error + type FieldFrontend struct + HideInDescriptions bool + HideInForm bool + HideInTable bool + Rules []pkg.BaseRule + Width string + func (f *FieldFrontend) Scan(val any) error + func (f *FieldFrontend) Value() (driver.Value, error) + type Fields []*Field + func (x Fields) Len() int + func (x Fields) Less(i, j int) bool + func (x Fields) Swap(i, j int) + type Language struct + Defines *LanguageDefines + Name string + Remark string + Status enum.Status + func (*Language) TableName() string + type LanguageDefine struct + Group string + ID string + Key string + Value string + type LanguageDefines []*LanguageDefine + func (l *LanguageDefines) Scan(val any) error + func (l *LanguageDefines) Value() (driver.Value, error) + type Menu struct + Access string + Children []*Menu + Component string + FixSiderbar bool + FixedHeader bool + FlatMenu bool + FooterRender bool + HeaderRender bool + HeaderTheme string + HideChildrenInMenu bool + HideInBreadcrumb bool + HideInMenu bool + Icon string + Layout string + MenuHeaderRender bool + MenuRender bool + Method string + Name string + NavTheme string + ParentID string + Path string + Permission string + Sort int + Status enum.Status + Target string + Type pkg.AccessType + func CompleteName(tree []*Menu) []*Menu + func GetMenuTree(list []*Menu) []*Menu + func TreeTransferToMenuSlice(tree []pkg.TreeImp) []*Menu + func (*Menu) TableName() string + func (e *Menu) AddChildren(children []pkg.TreeImp) + func (e *Menu) BeforeCreate(tx *gorm.DB) error + func (e *Menu) BeforeSave(_ *gorm.DB) error + func (e *Menu) GetIndex() string + func (e *Menu) GetParentID() string + func (e *Menu) SortChildren() + type MenuList []*Menu + func (x MenuList) Len() int + func (x MenuList) Less(i, j int) bool + func (x MenuList) Swap(i, j int) + type Metadata map[string]string + func (m *Metadata) Scan(val any) error + func (m *Metadata) Value() (driver.Value, error) + type Model struct + Auth bool + Description string + Fields []*Field + GeneratedData bool + HardDeleted bool + MultiTenant bool + Name string + Path string + Table string + func (*Model) TableName() string + func (e *Model) BeforeCreate(_ *gorm.DB) error + func (e *Model) GetKey() string + func (e *Model) GetModels(ctx *gin.Context) ([]center.VirtualModelImp, error) + func (e *Model) Make() *model.Model + func (e *Model) MakeVirtualModel() *model.Model + type ModelGormTenant struct + TenantID string + func (e *ModelGormTenant) BeforeCreate(tx *gorm.DB) (err error) + func (e *ModelGormTenant) BeforeDelete(tx *gorm.DB) error + type Notice struct + Avatar string + Datetime *time.Time + Description string + Extra string + Key string + Read bool + Status string + Title string + Type NoticeType + UserID string + func (e *Notice) TableName() string + type NoticeType string + const NoticeTypeEvent + const NoticeTypeMessage + const NoticeTypeNotification + func (e NoticeType) String() string + type Option struct + Items *OptionItems + Name string + Remark string + Status enum.Status + func (*Option) TableName() string + type OptionItem struct + Color string + ID string + Key string + Label string + Sort int + Value string + type OptionItems []*OptionItem + func (o *OptionItems) Scan(val any) error + func (o *OptionItems) Value() (driver.Value, error) + type Post struct + Children []*Post + Code string + DataScope DataScope + DeptIDS string + DeptIDSArr []string + Name string + ParentID string + Sort int + Status enum.Status + func (*Post) TableName() string + func (e *Post) AddChildren(children []pkg.TreeImp) + func (e *Post) AfterFind(_ *gorm.DB) error + func (e *Post) BeforeSave(_ *gorm.DB) error + func (e *Post) GetAllChildrenID(tx *gorm.DB) []string + func (e *Post) GetChildrenID(tx *gorm.DB) []string + func (e *Post) GetIndex() string + func (e *Post) GetParentID() string + func (e *Post) SortChildren() + type PostList []*Post + func (x PostList) Len() int + func (x PostList) Less(i, j int) bool + func (x PostList) Swap(i, j int) + type Role struct + Default bool + Name string + Remark string + Root bool + Status enum.Status + func (*Role) TableName() string + type Statistics struct + Name string + Time string + Type string + Value int + func (*Statistics) TableName() string + func (e *Statistics) Calibrate(ctx *gin.Context, object center.StatisticsObject) error + func (e *Statistics) Increase(ctx *gin.Context, object center.StatisticsObject) error + func (e *Statistics) Reduce(ctx *gin.Context, object center.StatisticsObject) error + type SystemConfig struct + BuiltIn bool + Content string + Ext source.Scheme + Name string + Remark string + func (*SystemConfig) TableName() string + func (e *SystemConfig) GenerateBytes() ([]byte, error) + func (e *SystemConfig) GetExtend() source.Scheme + type Tag struct + Key string + Label string + type Task struct + Args ArrayString + Body string + CheckedAt sql.NullTime + CheckedAtR *time.Time + Command string + Endpoint string + EntryID int + Metadata string + Method string + Name string + Once bool + Protocol string + Python string + Remark string + Spec string + Status enum.Status + Timeout int + func (*Task) TableName() string + func (t *Task) AfterFind(tx *gorm.DB) (err error) + func (t *Task) BeforeDelete(_ *gorm.DB) (err error) + func (t *Task) Run() + type TaskRun struct + CreatedAt time.Time + ID string + Status enum.Status + TaskID string + func (*TaskRun) TableName() string + func (t *TaskRun) BeforeCreate(_ *gorm.DB) (err error) + func (t *TaskRun) Write(p []byte) (int, error) + type TaskRunLog struct + Content string + CreatedAt time.Time + ID string + TaskRunID string + func (*TaskRunLog) TableName() string + func (l *TaskRunLog) BeforeCreate(_ *gorm.DB) (err error) + type TaskStorage struct + DB *gorm.DB + Spec string + func (t *TaskStorage) Get(key string) (entryID cron.EntryID, spec string, job cron.Job, exist bool, err error) + func (t *TaskStorage) ListKeys() ([]string, error) + func (t *TaskStorage) Remove(key string) error + func (t *TaskStorage) Set(key string, entryID cron.EntryID, spec string, job cron.Job) error + func (t *TaskStorage) Update(key string, entryID cron.EntryID) error + type Tenant struct + Default bool + Domains []*TenantDomain + Expire *time.Time + Name string + Remark string + Status enum.Status + func (*Tenant) TableName() string + func (t *Tenant) AfterDelete(tx *gorm.DB) error + func (t *Tenant) AfterSave(tx *gorm.DB) error + func (t *Tenant) BeforeSave(_ *gorm.DB) error + func (t *Tenant) GetDB(ctx *gin.Context, table schema.Tabler) *gorm.DB + func (t *Tenant) GetID() any + func (t *Tenant) GetTenant(ctx *gin.Context) (center.TenantImp, error) + func (t *Tenant) Migrate(tx *gorm.DB) error + func (t *Tenant) Scope(ctx *gin.Context, table schema.Tabler) func(db *gorm.DB) *gorm.DB + type TenantDomain struct + Domain string + Name string + TenantID string + func (*TenantDomain) TableName() string + type User struct + Address string + Avatar string + City string + Country string + Group string + Name string + Permissions map[string]bool + Phone string + Profile string + Province string + Signature string + Tags ArrayString + Title string + func GetUserByUsername(username string) (*User, error) + func (*User) StatisticsName() string + func (*User) StatisticsStep() int + func (*User) StatisticsTime() string + func (*User) StatisticsType() string + func (*User) TableName() string + func (e *User) AfterCreate(tx *gorm.DB) error + func (e *User) AfterDelete(tx *gorm.DB) error + func (e *User) BeforeCreate(tx *gorm.DB) error + func (e *User) GetUserID() string + func (e *User) StatisticsCalibrate() (int, error) + type UserLogin struct + Department *Department + DepartmentID string + Email string + OAuth2 []*UserOAuth2 + Password string + PasswordHash string + Post *Post + PostID string + Provider string + Role *Role + RoleID string + Salt string + Status enum.Status + Username string + func (e *UserLogin) GetCustomDepartmentUserID(tx *gorm.DB) []string + func (e *UserLogin) GetDepartmentAndChildrenUserID(tx *gorm.DB) []string + func (e *UserLogin) GetDepartmentUserID(tx *gorm.DB) []string + func (e *UserLogin) GetEmail() string + func (e *UserLogin) GetPostAndAllChildrenUserID(tx *gorm.DB) []string + func (e *UserLogin) GetPostAndChildrenUserID(tx *gorm.DB) []string + func (e *UserLogin) GetPostUserID(tx *gorm.DB) []string + func (e *UserLogin) GetRoleID() string + func (e *UserLogin) GetTenantID() string + func (e *UserLogin) GetUserID() string + func (e *UserLogin) GetUsername() string + func (e *UserLogin) Root() bool + func (e *UserLogin) Scope(ctx *gin.Context, table schema.Tabler) func(db *gorm.DB) *gorm.DB + func (e *UserLogin) TableName() string + func (e *UserLogin) Verify(ctx context.Context) (bool, security.Verifier, error) + type UserOAuth2 struct + Address string + Birthdata string + Email string + EmailVerified bool + FamilyName string + Gender string + GivenName string + Locale string + MiddleName string + Name string + NickName string + OpenID string + PhoneNumber string + PhoneNumberVerified bool + Picture string + PreferredUsername string + Profile string + Sub string + User *User + UserID string + Website string + Zoneinfo string + func (*UserOAuth2) TableName() string