Versions in this module Expand all Collapse all v0 v0.2.1 Nov 15, 2016 v0.2.0 Nov 13, 2016 Changes in this version + const ProvideTypeEmail + const RoleAdmin + const RoleRoot + func CreateCertificate(ca bool, subject pkix.Name, years int) ([]byte, []byte, error) + func WritePemFile(file, _type string, buf []byte) error + type Dao struct + Aes *web.Aes + Cache *web.Cache + Db *gorm.DB + Hmac *web.Hmac + I18n *web.I18n + func (p *Dao) AddEmailUser(lang, email, name, password string) (*User, error) + func (p *Dao) AddOpenIDUser(pid, pty, email, name, home, logo string) (*User, error) + func (p *Dao) Allow(role uint, 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) Get(key string, val interface{}) error + func (p *Dao) GetUserByEmail(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, msg string) + func (p *Dao) Logf(user uint, lang, format string, args ...interface{}) + func (p *Dao) Role(name string, rty string, rid uint) (*Role, error) + func (p *Dao) Set(key string, val interface{}, flag bool) error + func (p *Dao) UserClaims(u *User) jws.Claims + type Engine struct + Cache *web.Cache + Dao *Dao + Db *gorm.DB + Handler *Handler + Hmac *web.Hmac + I18n *web.I18n + Jwt *Jwt + Server *machinery.Server + func (p *Engine) Home() gin.HandlerFunc + func (p *Engine) Init(inj *inject.Graph) error + func (p *Engine) Mount(rt *gin.Engine) + func (p *Engine) Shell() []cli.Command + func (p *Engine) Worker() + type Handler struct + Dao *Dao + I18n *web.I18n + func (p *Handler) CurrentUser(c *gin.Context) + func (p *Handler) MustAdmin(c *gin.Context) + func (p *Handler) MustSignIn(c *gin.Context) + type Jwt struct + Dao *Dao + Key []byte + Method crypto.SigningMethod + func (p *Jwt) CurrentUserHandler(must bool) gin.HandlerFunc + func (p *Jwt) MustAdminHandler() gin.HandlerFunc + func (p *Jwt) MustRolesHandler(roles ...string) gin.HandlerFunc + func (p *Jwt) Sum(cm jws.Claims, days int) ([]byte, error) + func (p *Jwt) Validate(buf []byte) (jwt.Claims, error) + type Leaveword struct + Content string + CreatedAt time.Time + ID uint + type Notice struct + Content string + Lang string + type SMTP struct + From string + Host string + Password string + Port int + Username string + type Setting struct + Flag bool + Key string + Val []byte v0.1.2 Nov 2, 2016 v0.1.1 Nov 1, 2016 Changes in this version type BaseController + func (p *BaseController) IsAdmin() bool + func (p *BaseController) IsSignIn() bool type Log + User *User type Permission + Role *Role + User *User type Role + Permissions []*Permission type User + Logs []*Log + Permissions []*Permission v0.1.0 Oct 28, 2016 Changes in this version + const AdminRole + const CurrentUser + const DefaultResourceID + const DefaultResourceType + const ProvideByEmail + const RootRole + func ConfirmUser(user *User) + func GenerateUserClaims(u *User) jws.Claims + func Register(args ...NavBarFunc) + type BaseController struct + func (p *BaseController) CurrentUser() *User + func (p *BaseController) Dashboard() + func (p *BaseController) MustAdmin() + func (p *BaseController) MustSignIn() + func (p *BaseController) Prepare() + func (p *BaseController) SetCurrentUser() + type Controller struct + func (p *Controller) GetChangePassword() + func (p *Controller) GetConfirm() + func (p *Controller) GetForgotPassword() + func (p *Controller) GetInfo() + func (p *Controller) GetLogs() + func (p *Controller) GetResetPassword() + func (p *Controller) GetSignIn() + func (p *Controller) GetSignOut() + func (p *Controller) GetSignUp() + func (p *Controller) PostChangePassword() + func (p *Controller) PostConfirm() + func (p *Controller) PostForgotPassword() + func (p *Controller) PostInfo() + func (p *Controller) PostResetPassword() + func (p *Controller) PostSignIn() + func (p *Controller) PostSignUp() + func (p *Controller) Prepare() + type Log struct + CreatedAt time.Time + ID uint + Message string + UserID uint + func (p *Log) TableName() string + type NavBarFunc func(*User) *base.Dropdown + type Permission struct + RoleID uint + ShutDown time.Time + StartUp time.Time + UserID uint + func (p *Permission) Begin() string + func (p *Permission) Enable() bool + func (p *Permission) End() string + func (p *Permission) TableName() string + type Role struct + Name string + ResourceID uint + ResourceType string + func (p *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 + Name string + Password string + ProviderID string + ProviderType string + SignInCount uint + UID string + func AddEmailUser(email, name, password string) (*User, error) + func AddOpenIDUser(pid, pty, email, name, home, logo string) (*User, error) + func GetUserByEmail(email string) (*User, error) + func GetUserByUID(uid string) (*User, error) + func (p *User) Allow(name, rty string, rid uint, years, months, days int) + func (p *User) Can(name string, rty string, rid uint) bool + func (p *User) Deny(name, rty string, rid uint) + func (p *User) GetRoleNames(rty string, rid uint) []string + func (p *User) Has(name string) bool + func (p *User) IsAvailable() bool + func (p *User) IsConfirmed() bool + func (p *User) IsLocked() bool + func (p *User) IsPassword(password string) bool + func (p *User) Log(msg string) + func (p *User) SetGravatarLogo() + func (p *User) SetPassword(password string) + func (p *User) SetUID() + func (p *User) TableName() string + func (p User) String() string