Versions in this module Expand all Collapse all v1 v1.0.0 Jan 5, 2018 Changes in this version + const CurrentUser + const DefaultResourceID + const DefaultResourceType + const ERROR + const IsAdmin + const MESSAGE + const NOTICE + const RoleAdmin + const RoleRoot + const SendEmailJob + const TITLE + const UID + const UserTypeEmail + const WARNING + func CreateCertificate(ca bool, subject pkix.Name, years int) ([]byte, []byte, error) + func WritePemFile(file, _type string, buf []byte, mode os.FileMode) error + type Attachment struct + CreatedAt time.Time + ID uint + Length int64 + MediaType string + ResourceID uint + ResourceType string + Title string + URL string + UpdatedAt time.Time + User User + UserID uint + func (p *Attachment) IsPicture() bool + func (p Attachment) TableName() string + type Card struct + Action string + CreatedAt time.Time + Href string + ID uint + Lang string + Loc string + Logo string + SortOrder int + Summary string + Title string + Type string + UpdatedAt time.Time + func (p Card) TableName() string + type Dao struct + I18n *web.I18n + Security *web.Security + func (p *Dao) AddEmailUser(db *gorm.DB, lang, ip, name, email, password string) (*User, error) + func (p *Dao) AddLog(db *gorm.DB, user uint, ip, lang, format string, args ...interface{}) error + func (p *Dao) Allow(db *gorm.DB, user uint, role uint, years, months, days int) error + func (p *Dao) Can(db *gorm.DB, user uint, name string, rty string, rid uint) bool + func (p *Dao) Deny(db *gorm.DB, user uint, role uint) error + func (p *Dao) GetRole(db *gorm.DB, name string, rty string, rid uint) (*Role, error) + func (p *Dao) GetUserByEmail(db *gorm.DB, email string) (*User, error) + func (p *Dao) GetUserByUID(db *gorm.DB, uid string) (*User, error) + func (p *Dao) Is(db *gorm.DB, user uint, names ...string) bool + func (p *Dao) SignIn(db *gorm.DB, lang, ip, email, password string) (*User, error) + type FriendLink struct + CreatedAt time.Time + Home string + ID uint + Logo string + SortOrder int + Title string + UpdatedAt time.Time + func (p FriendLink) TableName() string + type HTMLHandlerFunc func(string, *gin.Context) (gin.H, error) + type Layout struct + DB *gorm.DB + Dao *Dao + I18n *web.I18n + Jwt *web.Jwt + Languages []string + Render *render.Render + Store sessions.Store + func (p *Layout) Backend(c *gin.Context) string + func (p *Layout) CurrentUserMiddleware(c *gin.Context) + func (p *Layout) Frontend(c *gin.Context) string + func (p *Layout) HTML(name string, handler HTMLHandlerFunc) gin.HandlerFunc + func (p *Layout) JSON(fn ObjectHandlerFunc) gin.HandlerFunc + func (p *Layout) MustAdminMiddleware(c *gin.Context) + func (p *Layout) MustSignInMiddleware(c *gin.Context) + func (p *Layout) Redirect(to string, fn RedirectHandlerFunc) gin.HandlerFunc + func (p *Layout) Save(c *gin.Context, s *sessions.Session) + func (p *Layout) Session(c *gin.Context) *sessions.Session + func (p *Layout) XML(fn ObjectHandlerFunc) gin.HandlerFunc + type LeaveWord struct + Body string + CreatedAt time.Time + ID uint + Type string + func (p LeaveWord) TableName() string + type Link struct + CreatedAt time.Time + Href string + ID uint + Label string + Lang string + Loc string + SortOrder int + UpdatedAt time.Time + func (p Link) TableName() string + type Log struct + CreatedAt time.Time + ID uint + IP string + Message string + User User + UserID uint + func (p Log) String() string + func (p Log) TableName() string + type ObjectHandlerFunc func(string, *gin.Context) (interface{}, error) + type Plugin struct + Cache *web.Cache + DB *gorm.DB + Dao *Dao + I18n *web.I18n + Jobber *web.Jobber + Jwt *web.Jwt + Languages []string + Layout *Layout + RSS *web.RSS + Redis *redis.Pool + Render *render.Render + Router *gin.Engine + S3 *web.S3 + Security *web.Security + Settings *web.Settings + Sitemap *web.Sitemap + func (p *Plugin) Init(g *inject.Graph) error + func (p *Plugin) Mount() error + func (p *Plugin) Shell() []cli.Command + type Policy struct + CreatedAt time.Time + ID uint + Role Role + RoleID uint + ShutDown time.Time + StartUp time.Time + UpdatedAt time.Time + User User + UserID uint + func (p *Policy) Enable() bool + func (p Policy) TableName() string + type RedirectHandlerFunc func(string, *gin.Context) error + type Role struct + CreatedAt time.Time + ID uint + Name string + ResourceID uint + ResourceType string + UpdatedAt time.Time + func (p Role) String() string + func (p Role) TableName() string + type User struct + ConfirmedAt *time.Time + CreatedAt time.Time + CurrentSignInAt *time.Time + CurrentSignInIP string + Email string + ID uint + LastSignInAt *time.Time + LastSignInIP string + LockedAt *time.Time + Logo string + Logs []Log + Name string + Password []byte + ProviderID string + ProviderType string + SignInCount uint + UID string + UpdatedAt time.Time + func (p *User) IsConfirm() bool + func (p *User) IsLock() bool + func (p *User) SetGravatarLogo() + func (p *User) SetUID() + func (p User) String() string + func (p User) TableName() string + type Vote struct + CreatedAt time.Time + ID uint + Point int + ResourceID uint + ResourceType string + UpdatedAt time.Time + func (p Vote) TableName() string