Versions in this module Expand all Collapse all v0 v0.4.0 May 18, 2023 Changes in this version type SSL + const Require v0.3.0 May 18, 2023 v0.2.0 May 18, 2023 Changes in this version + const ALERT + const CRITICAL + const DEBUG + const EMERGENCY + const ERROR + const INFO + const NONE + const OK + const Version + const VersionCodeName + const WARNING + const WORKING + var APIDisabledAdd = false + var APIDisabledDelete = false + var APIDisabledEdit = false + var APIDisabledRead = false + var APIDisabledSchema = false + var APILogAdd = true + var APILogDelete = true + var APILogEdit = true + var APILogRead = false + var APILogSchema = true + var APIPostQueryAdd = false + var APIPostQueryAddHandler func(http.ResponseWriter, *http.Request, map[string]interface{}) bool + var APIPostQueryDelete = false + var APIPostQueryDeleteHandler func(http.ResponseWriter, *http.Request, map[string]interface{}) bool + var APIPostQueryEdit = false + var APIPostQueryEditHandler func(http.ResponseWriter, *http.Request, map[string]interface{}) bool + var APIPostQueryRead = false + var APIPostQueryReadHandler func(http.ResponseWriter, *http.Request, map[string]interface{}) bool + var APIPostQuerySchema = false + var APIPreQueryAdd = false + var APIPreQueryAddHandler func(http.ResponseWriter, *http.Request) bool + var APIPreQueryDelete = false + var APIPreQueryDeleteHandler func(http.ResponseWriter, *http.Request) bool + var APIPreQueryEdit = false + var APIPreQueryEditHandler func(http.ResponseWriter, *http.Request) bool + var APIPreQueryRead = false + var APIPreQueryReadHandler func(http.ResponseWriter, *http.Request) bool + var APIPreQuerySchema = false + var APIPublicAdd = false + var APIPublicDelete = false + var APIPublicEdit = false + var APIPublicRead = false + var APIPublicSchema = false + var AcceptedJWTIssuers = []string + var AllowDAPISignup = false + var AllowedCORSOrigins []string + var AllowedHosts = "0.0.0.0,127.0.0.1,localhost,::1" + var AllowedIPs = "*" + var ApprovalHandleFunc func(*Approval) bool + var BindIP = "" + var BlockedIPs = "" + var CachePermissions = true + var CacheSessions = true + var CacheTranslation = false + var CookieTimeout = -1 + var CustomDAPIHeaders = map[string]string + var CustomDAPILoginHandler func(*http.Request, *User, map[string]interface{}) map[string]interface + var CustomEmailHandler func(to, cc, bcc *[]string, subject, body *string, attachments ...*string) (bool, error) + var CustomJWT func(r *http.Request, s *Session, payload map[string]interface{}) map[string]interface + var CustomOpenAPI func(*openapi.Schema) + var CustomOpenAPIJSON func([]byte) []byte + var CustomResetPasswordLink = "" + var CustomTranslation = []string + var CustomizeJSON func(http.ResponseWriter, *http.Request, interface{}, []byte) []byte + var DAPISignupActive = true + var DAPISignupAllowRemote = true + var DAPISignupGroupID = 0 + var DebugDB = false + var DefaultMediaPermission = os.FileMode(0644) + var DisableAdminUI = false + var DisableDAPIAuth = true + var EmailFrom string + var EmailPassword string + var EmailSMTPServer string + var EmailSMTPServerPort int + var EmailUsername string + var EnableDAPICORS bool + var EncryptKey = []byte + var ErrorHandleFunc func(int, string, string) + var FavIcon = "/static/uadmin/favicon.ico" + var FullMediaURL = false + var HTTPLogFormat = "%a %>s %B %U %D" + var JWT = "" + var JWTIssuer = "" + var LogAdd = true + var LogDelete = true + var LogEdit = true + var LogHTTPRequests = true + var LogRead = false + var LogTrail = false + var Logo = "/static/uadmin/logo.png" + var MaskPasswordInAPI = true + var MaxImageHeight = 600 + var MaxImageWidth = 800 + var MaxUploadFileSize = int64(25 * 1024 * 1024) + var OTPAlgorithm = "sha1" + var OTPDigits = 6 + var OTPPeriod = uint(30) + var OTPSkew = uint(5) + var OptimizeSQLQuery = false + var PageLength = 100 + var PasswordAttempts = 5 + var PasswordTimeout = 15 + var Port = 8080 + var PostUploadHandler func(filePath string, modelName string, f *F) string + var PreLoginHandler func(r *http.Request, username string, password string) + var PublicMedia = false + var RateLimit int64 = 3 + var RateLimitBurst int64 = 3 + var ReportTimeStamp = false + var ReportingLevel = DEBUG + var ResetPasswordMessage = ... + var RestrictSessionIP = false + var RetainMediaVersions = true + var RootURL = "/" + var Salt = "" + var Schema map[string]ModelSchema + var ServerReady = false + var SignupValidationHandler func(user *User) error + var SiteName = "uAdmin" + var SystemMetrics = false + var Theme = "default" + var TimeZone = "local" + var TrailCacheSize = 65536 + var TrailLoggingLevel = INFO + var UserMetrics = false + func ABTestClick(r *http.Request, group string) + func AdminPage(order string, asc bool, offset int, limit int, a interface{}, ...) (err error) + func All(a interface{}) (err error) + func Avg(a interface{}, column string, query interface{}, args ...interface{}) float64 + func AvgTable(table string, column string, query interface{}, args ...interface{}) float64 + func CORSHandler(f func(w http.ResponseWriter, r *http.Request)) func(w http.ResponseWriter, r *http.Request) + func CheckCSRF(r *http.Request) bool + func CheckRateLimit(r *http.Request) bool + func ClearDB() + func Count(a interface{}, query interface{}, args ...interface{}) int + func CountTable(table string, query interface{}, args ...interface{}) int + func Delete(a interface{}) (err error) + func DeleteList(a interface{}, query interface{}, args ...interface{}) (err error) + func Filter(a interface{}, query interface{}, args ...interface{}) (err error) + func FilterBuilder(params map[string]interface{}) (query string, args []interface{}) + func FilterList(s *ModelSchema, order string, asc bool, offset int, limit int, a interface{}, ...) (err error) + func FilterSorted(order string, asc bool, a interface{}, query interface{}, args ...interface{}) (err error) + func FilterSortedTable(table string, order string, asc bool, a interface{}, query interface{}, ...) (err error) + func FilterSortedValue(table string, column string, order string, asc bool, a interface{}, ...) (err error) + func FilterTable(table string, a interface{}, query interface{}, args ...interface{}) (err error) + func GenerateBase32(length int) string + func GenerateBase64(length int) string + func GenerateOpenAPISchema() + func Get(a interface{}, query interface{}, args ...interface{}) (err error) + func GetABTest(r *http.Request, a interface{}, query interface{}, args ...interface{}) (err error) + func GetDB() *gorm.DB + func GetFieldsAPI(w http.ResponseWriter, r *http.Request, session *Session) + func GetForm(a interface{}, s *ModelSchema, query interface{}, args ...interface{}) (err error) + func GetHostName(r *http.Request) string + func GetID(m reflect.Value) uint + func GetModelsAPI(w http.ResponseWriter, r *http.Request, session *Session) + func GetRemoteIP(r *http.Request) string + func GetSchema(r *http.Request) string + func GetSetting(code string) interface + func GetSorted(order string, asc bool, a interface{}, query interface{}, args ...interface{}) (err error) + func GetSortedTable(table string, order string, asc bool, a interface{}, query interface{}, ...) (err error) + func GetString(a interface{}) string + func GetStringer(a interface{}, query interface{}, args ...interface{}) (err error) + func GetTable(table string, a interface{}, query interface{}, args ...interface{}) (err error) + func GetValueSorted(table string, column string, order string, asc bool, a interface{}, ...) (err error) + func Handler(f func(http.ResponseWriter, *http.Request)) func(http.ResponseWriter, *http.Request) + func IncrementMetric(name string) + func JSONMarshal(v interface{}, safeEncoding bool) ([]byte, error) + func Logout(r *http.Request) + func Max(a interface{}, column string, query interface{}, args ...interface{}) float64 + func MaxTable(table string, column string, query interface{}, args ...interface{}) float64 + func Min(a interface{}, column string, query interface{}, args ...interface{}) float64 + func MinTable(table string, column string, query interface{}, args ...interface{}) float64 + func NewMetric(name string, template string) error + func NewModel(modelName string, pointer bool) (reflect.Value, bool) + func NewModelArray(modelName string, pointer bool) (reflect.Value, bool) + func Preload(a interface{}, preload ...string) (err error) + func Register(m ...interface{}) + func RegisterInlines(model interface{}, fk map[string]string) + func RegisterTrailChan(c chan string) + func RenderHTML(w http.ResponseWriter, r *http.Request, path string, data interface{}, ...) + func RenderMultiHTML(w http.ResponseWriter, r *http.Request, path []string, data interface{}, ...) + func ReturnJSON(w http.ResponseWriter, r *http.Request, v interface{}) + func SQLInjection(r *http.Request, key, value string) bool + func Save(a interface{}) (err error) + func SendEmail(to, cc, bcc []string, subject, body string, attachments ...string) (err error) + func SetMetric(name string, value float64) + func SetSessionCookie(w http.ResponseWriter, r *http.Request, s *Session) string + func StartSecureServer(certFile, keyFile string) + func StartServer() + func StaticHandler(w http.ResponseWriter, r *http.Request) + func Std(a interface{}, column string, query interface{}, args ...interface{}) float64 + func StdTable(table string, column string, query interface{}, args ...interface{}) float64 + func Sum(a interface{}, column string, query interface{}, args ...interface{}) float64 + func SumTable(table string, column string, query interface{}, args ...interface{}) float64 + func Syslogf(level int, msg string, a ...interface{}) — darwin/amd64, js/wasm, linux/amd64 + func Syslogf(level int, msg string, a ...interface{}) error — windows/amd64 + func Tf(path string, lang string, term string, args ...interface{}) string + func TimeMetric(name string, div float64, f func()) + func Trail(level int, msg interface{}, i ...interface{}) + func Translate(raw string, lang string, args ...bool) string + func TranslateSchema(s *ModelSchema, lang string) + func Update(a interface{}, fieldName string, value interface{}, query string, ...) (err error) + func UploadImageHandler(w http.ResponseWriter, r *http.Request, session *Session) + func ValidateIP(r *http.Request, allow string, block string) bool + type ABTest struct + Active bool + Field FieldList + Group string + ModelName ModelList + Name string + PrimaryKey int + ResetABTest string + StaticPath string + Type ABTestType + func (a *ABTest) Save() + func (a ABTest) Reset() + type ABTestType int + func (ABTestType) Model() ABTestType + func (ABTestType) Static() ABTestType + type ABTestValue struct + ABTest ABTest + ABTestID uint + Active bool + Clicks int + Impressions int + Value string + func (ABTestValue) HideInDashboard() bool + func (a *ABTestValue) ClickThroughRate() float64 + func (a *ABTestValue) String() string + func (a ABTestValue) ClickThroughRate__Form__List() string + func (a ABTestValue) Preview__Form__List() string + type APIDisabledAdder interface + APIDisabledAdd func(*http.Request) bool + type APIDisabledDeleter interface + APIDisabledDelete func(*http.Request) bool + type APIDisabledEditor interface + APIDisabledEdit func(*http.Request) bool + type APIDisabledReader interface + APIDisabledRead func(*http.Request) bool + type APIDisabledSchemer interface + APIDisabledSchema func(*http.Request) bool + type APILogAdder interface + APILogAdd func(*http.Request) bool + type APILogDeleter interface + APILogDelete func(*http.Request) bool + type APILogEditor interface + APILogEdit func(*http.Request) bool + type APILogReader interface + APILogRead func(*http.Request) bool + type APILogSchemer interface + APILogSchema func(*http.Request) bool + type APIPostQueryAdder interface + APIPostQueryAdd func(http.ResponseWriter, *http.Request, map[string]interface{}) bool + type APIPostQueryDeleter interface + APIPostQueryDelete func(http.ResponseWriter, *http.Request, map[string]interface{}) bool + type APIPostQueryEditor interface + APIPostQueryEdit func(http.ResponseWriter, *http.Request, map[string]interface{}) bool + type APIPostQueryReader interface + APIPostQueryRead func(http.ResponseWriter, *http.Request, map[string]interface{}) bool + type APIPostQuerySchemer interface + APIPostQuerySchema func(http.ResponseWriter, *http.Request, map[string]interface{}) bool + type APIPreQueryAdder interface + APIPreQueryAdd func(http.ResponseWriter, *http.Request) bool + type APIPreQueryDeleter interface + APIPreQueryDelete func(http.ResponseWriter, *http.Request) bool + type APIPreQueryEditor interface + APIPreQueryEdit func(http.ResponseWriter, *http.Request) bool + type APIPreQueryReader interface + APIPreQueryRead func(http.ResponseWriter, *http.Request) bool + type APIPreQuerySchemer interface + APIPreQuerySchema func(http.ResponseWriter, *http.Request) bool + type APIPublicAdder interface + APIPublicAdd func(*http.Request) bool + type APIPublicDeleter interface + APIPublicDelete func(*http.Request) bool + type APIPublicEditor interface + APIPublicEdit func(*http.Request) bool + type APIPublicReader interface + APIPublicRead func(*http.Request) bool + type APIPublicSchemer interface + APIPublicSchema func(*http.Request) bool + type Action int + func (a Action) Added() Action + func (a Action) Custom() Action + func (a Action) Deleted() Action + func (a Action) GetSchema() Action + func (a Action) LoginDenied() Action + func (a Action) LoginSuccessful() Action + func (a Action) Logout() Action + func (a Action) Modified() Action + func (a Action) PasswordResetDenied() Action + func (a Action) PasswordResetRequest() Action + func (a Action) PasswordResetSuccessful() Action + func (a Action) Read() Action + type Approval struct + ApprovalAction ApprovalAction + ApprovalBy string + ApprovalDate *time.Time + ChangeDate time.Time + ChangedBy string + ColumnName string + ModelName string + ModelPK uint + NewValue string + NewValueDescription string + OldValue string + UpdatedBy string + ViewRecord string + func (a *Approval) Save() + func (a *Approval) String() string + type ApprovalAction int + func (ApprovalAction) Approved() ApprovalAction + func (ApprovalAction) Rejected() ApprovalAction + type AutoMigrater interface + AutoMigrate func() bool + type CKey string + type Choice struct + K uint + Selected bool + V string + type DBSettings struct + Host string + Name string + Password string + Port int + SSL SSL + Timezone string + Type string + User string + var Database *DBSettings + type DashboardMenu struct + Cat string + Hidden bool + Icon string + MenuName string + ToolTip string + URL string + func (m DashboardMenu) GetImageSize() (int, int) + func (m DashboardMenu) String() string + type DataType int + func (DataType) Boolean() DataType + func (DataType) DateTime() DataType + func (DataType) File() DataType + func (DataType) Float() DataType + func (DataType) Image() DataType + func (DataType) Integer() DataType + func (DataType) String() DataType + type F struct + Approval bool + ApprovalAction ApprovalAction + ApprovalBy string + ApprovalDate *time.Time + ApprovalID uint + CategoricalFilter bool + ChangeDate *time.Time + ChangedBy string + Choices []Choice + ColumnName string + DefaultValue string + Deprecated bool + DisplayName string + Encrypt bool + ErrMsg string + Filter bool + FormDisplay bool + Format string + Help string + Hidden bool + IsMethod bool + LimitChoicesTo func(interface{}, *User) []Choice + ListDisplay bool + Max interface{} + Min interface{} + Name string + NewValue interface{} + OldValue interface{} + Pattern string + PatternMsg string + ProgressBar map[float64]string + ReadOnly string + Required bool + Searchable bool + Stringer bool + Translations []translation + Type string + TypeName string + UploadTo string + Value interface{} + WebCam bool + func (f F) MarshalJSON() ([]byte, error) + type FieldList int + type FieldType int + func (FieldType) Boolean() FieldType + func (FieldType) Code() FieldType + func (FieldType) DateTime() FieldType + func (FieldType) DateTimePtr() FieldType + func (FieldType) Email() FieldType + func (FieldType) File() FieldType + func (FieldType) Float() FieldType + func (FieldType) ForeignKey() FieldType + func (FieldType) HTML() FieldType + func (FieldType) Image() FieldType + func (FieldType) Int() FieldType + func (FieldType) Link() FieldType + func (FieldType) M2M() FieldType + func (FieldType) Money() FieldType + func (FieldType) Multilingual() FieldType + func (FieldType) Password() FieldType + func (FieldType) ProgressBar() FieldType + func (FieldType) StaticList() FieldType + func (FieldType) String() FieldType + type GetImageSizer interface + GetImageSize func() (int, int) + type GroupPermission struct + Add bool + Approval bool + DashboardMenu DashboardMenu + DashboardMenuID uint + Delete bool + Edit bool + Read bool + UserGroup UserGroup + UserGroupID uint + func (GroupPermission) HideInDashboard() bool + func (g *GroupPermission) Save() + func (g GroupPermission) String() string + type HideInDashboarder interface + HideInDashboard func() bool + type Language struct + Active bool + AvailableInGui bool + Code string + Default bool + EnglishName string + Flag string + Name string + RTL bool + func GetActiveLanguages() []Language + func GetDefaultLanguage() Language + func (l *Language) Save() + func (l Language) String() string + type Log struct + Action Action + Activity string + CreatedAt time.Time + RollBack string + TableID int + TableName string + Username string + func (l *Log) ParseRecord(a reflect.Value, modelName string, ID uint, user *User, action Action, ...) (err error) + func (l *Log) PasswordReset(user string, action Action, r *http.Request) (err error) + func (l *Log) Save() + func (l *Log) SignIn(user string, action Action, r *http.Request) (err error) + func (l Log) String() string + type Model struct + DeletedAt gorm.DeletedAt + ID uint + type ModelList int + type ModelSchema struct + Category string + DisplayName string + Fields []F + FormModifier func(*ModelSchema, interface{}, *User) + FormTheme string + IncludeFormJS []string + IncludeListJS []string + Inlines []*ModelSchema + InlinesData []listData + ListModifier func(*ModelSchema, *User) (string, []interface{}) + ListTheme string + ModelID uint + ModelName string + Name string + TableName string + func (s *ModelSchema) GetFormTheme() string + func (s *ModelSchema) GetListTheme() string + func (s ModelSchema) FieldByColumnName(a string) *F + func (s ModelSchema) FieldByName(a string) *F + func (s ModelSchema) MarshalJSON() ([]byte, error) + type SSL string + const Allow + const Disable + const Prefer + const Required + const VerfifyFull + const VerifyCa + type SchemaCategory interface + SchemaCategory func() string + type Session struct + Active bool + ExpiresOn *time.Time + IP string + Key string + LastLogin time.Time + LoginTime time.Time + PendingOTP bool + User User + UserID uint + func IsAuthenticated(r *http.Request) *Session + func Login(r *http.Request, username string, password string) (*Session, bool) + func Login2FA(r *http.Request, username string, password string, otpPass string) *Session + func Login2FAKey(r *http.Request, key string, otpPass string) *Session + func (Session) HideInDashboard() bool + func (s *Session) GenerateKey() + func (s *Session) Logout() + func (s *Session) Save() + func (s Session) String() string + type Setting struct + Category SettingCategory + CategoryID uint + Code string + DataType DataType + DefaultValue string + Help string + Name string + Value string + func (s *Setting) ApplyValue() + func (s *Setting) GetCode() string + func (s *Setting) GetValue() interface{} + func (s *Setting) ParseFormValue(v []string) + func (s *Setting) Save() + type SettingCategory struct + Icon string + Name string + type User struct + Active bool + Admin bool + Email string + ExpiresOn *time.Time + FirstName string + LastLogin *time.Time + LastName string + OTPRequired bool + OTPSeed string + Password string + PasswordReset *time.Time + Photo string + RemoteAccess bool + UserGroup UserGroup + UserGroupID uint + Username string + func GetUserFromRequest(r *http.Request) *User + func (u *User) GeneratePasswordResetLink(r *http.Request, link string) (string, error) + func (u *User) GeneratePasswordResetOTP() string + func (u *User) GetAccess(modelName string) UserPermission + func (u *User) GetActiveSession() *Session + func (u *User) GetDashboardMenu() (menus []DashboardMenu) + func (u *User) GetOTP() string + func (u *User) HasAccess(modelName string) UserPermission + func (u *User) Login(pass string, otp string) *Session + func (u *User) Save() + func (u *User) VerifyOTP(pass string) bool + func (u *User) VerifyOTPAtPasswordReset(pass string) bool + func (u User) String() string + func (u User) Validate() (ret map[string]string) + type UserGroup struct + GroupName string + func (u *UserGroup) HasAccess(modelName string) GroupPermission + func (u UserGroup) String() string + type UserPermission struct + Add bool + Approval bool + DashboardMenu DashboardMenu + DashboardMenuID uint + Delete bool + Edit bool + Read bool + User User + UserID uint + func (UserPermission) HideInDashboard() bool + func (u *UserPermission) Save() + func (u UserPermission) String() string