Versions in this module Expand all Collapse all v1 v1.0.0 Mar 31, 2017 Changes in this version type Engine + Queue *web.Queue v0 v0.4.1 Mar 23, 2017 Changes in this version type Attachment + func (p *Attachment) IsPicture() bool type Dao + I18n *web.I18n + func (p *Dao) SignIn(email, password, lang, ip string) (*User, error) v0.4.0 Mar 19, 2017 Changes in this version + const TOKEN + func HTML(f func(*gin.Context, string, gin.H) (string, error)) gin.HandlerFunc type Engine + func (p *Engine) Dashboard(c *gin.Context) *web.Dropdown v0.3.1 Mar 17, 2017 Changes in this version type Engine + Uploader web.Uploader v0.3.0 Mar 11, 2017 Changes in this version + const CurrentUser + const IsAdmin type Engine + func (p *Engine) RegisterWorker() type Jwt + func (p *Jwt) CurrentUserMiddleware(c *gin.Context) + func (p *Jwt) MustAdminMiddleware(c *gin.Context) + func (p *Jwt) MustSignInMiddleware(c *gin.Context) v0.2.0 Mar 7, 2017 Changes in this version + const UID + func Action(fn func(*cli.Context, *inject.Graph) error) cli.ActionFunc type Attachment + UserID uint + type Dao struct + Db *gorm.DB + Security *web.Security + func (p *Dao) AddEmailUser(name, email, password string) (*User, error) + func (p *Dao) Allow(role, user uint, years, months, days int) error + func (p *Dao) Authority(user uint, rty string, rid uint) []string + func (p *Dao) Can(user uint, name string, rty string, rid uint) bool + func (p *Dao) Deny(role uint, user uint) error + func (p *Dao) GetByEmail(email string) (*User, error) + func (p *Dao) GetUserByUID(uid string) (*User, error) + func (p *Dao) Is(user uint, name string) bool + func (p *Dao) Log(user uint, ip, message string) + func (p *Dao) Role(name string, rty string, rid uint) (*Role, error) + type Engine struct + Cache *web.Cache + Ctx *web.Context + Dao *Dao + Db *gorm.DB + I18n *web.I18n + Jwt *Jwt + Mux *web.Mux + Security *web.Security + Server *machinery.Server + Session *Session + Settings *web.Settings + func (p *Engine) Atom() ([]*atom.Entry, error) + func (p *Engine) Do() + func (p *Engine) Mount() + func (p *Engine) NavBar(r *http.Request) ([]web.Link, *web.Dropdown) + func (p *Engine) Shell() []cli.Command + func (p *Engine) Sitemap() ([]stm.URL, error) + type Jwt struct + Dao *Dao + I18n *web.I18n + Key []byte + Method crypto.SigningMethod + func (p *Jwt) Parse(r *http.Request) (jwt.Claims, error) + func (p *Jwt) Sum(cm jws.Claims, exp time.Duration) ([]byte, error) + func (p *Jwt) Validate(buf []byte) (jwt.Claims, error) type Log + Type string + UserID uint type Policy + RoleID uint + UserID uint + type Session struct + Ctx *web.Context + Dao *Dao + I18n *web.I18n + func (p *Session) CheckAdmin(w http.ResponseWriter, r *http.Request, must bool) bool + func (p *Session) CheckSignIn(w http.ResponseWriter, r *http.Request, must bool) bool + func (p *Session) CurrentUser(r *http.Request) *User + func (p *Session) CurrentUserMiddleware(w http.ResponseWriter, r *http.Request, next http.HandlerFunc) v0.1.0 Feb 9, 2017 Changes in this version + const DefaultIP + const DefaultResourceID + const DefaultResourceType + const RoleAdmin + const RoleRoot + const UserTypeEmail + func Allow(user *User, role string, years, months, days int) error + func ConfirmUser(user *User) error + func Deny(user *User, role string) error + func SetSignIn(user *User, ip string) error + type Attachment struct + CreatedAt time.Time + ID uint + Length uint + MediaType string + ResourceID uint + ResourceType string + SortOrder int + Title string + URL string + User *User + func (Attachment) TableName() string + type Controller struct + func (c *Controller) Index() + func (p *Controller) GetSignIn() + func (p *Controller) PostSignIn() + type Log struct + CreatedAt time.Time + ID uint + IP string + Message string + User *User + func (Log) TableName() string + type Policy struct + Role *Role + ShutDown time.Time + StartUp time.Time + User *User + func (Policy) TableName() string + func (p *Policy) Enable() bool + type Role struct + Name string + ResourceID uint + ResourceType string + func (Role) TableName() string + func (p Role) String() string + type User struct + ConfirmedAt *time.Time + CurrentSignInAt *time.Time + CurrentSignInIP string + Email string + Home string + LastSignInAt *time.Time + LastSignInIP string + LockedAt *time.Time + Logo string + Logs []*Log + Name string + Password string + ProviderID string + ProviderType string + SignInCount uint + UID string + func AddEmailUser(name, email, password string) (*User, error) + func (User) TableName() string + func (p *User) IsConfirm() bool + func (p *User) IsLock() bool + func (p *User) SetGravatarLogo() + func (p *User) SetUID() + func (p User) String() string + type UserController struct + func (p *UserController) CurrentUser() *User + func (p *UserController) Prepare() + type Vote struct + Point int + ResourceID uint + ResourceType string + func (Vote) TableName() string