Versions in this module Expand all Collapse all v0 v0.0.2 Jun 23, 2016 v0.0.1 Jun 12, 2016 Changes in this version + func Secret(i, l int) []byte + func SendMail(to, subject, body string, html bool, files ...string) + func Shell(cmd string, args ...string) error + type AesHmacEncryptor struct + Cipher cipher.Block + Hash hash.Hash + func (p *AesHmacEncryptor) Decode(buf []byte) ([]byte, error) + func (p *AesHmacEncryptor) Encode(buf []byte) ([]byte, error) + func (p *AesHmacEncryptor) Equal(plain, code []byte) bool + func (p *AesHmacEncryptor) Sum(buf []byte) []byte + type Dao struct + Db *gorm.DB + Encryptor Encryptor + Logger *logging.Logger + func (p *Dao) AddUser(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(k string, v interface{}) error + func (p *Dao) GetUser(uid string) (*User, error) + func (p *Dao) Is(user uint, name string) bool + func (p *Dao) Log(user uint, msg string) + func (p *Dao) Role(name string, rty string, rid uint) (*Role, error) + func (p *Dao) Set(k string, v interface{}, f bool) error + func (p *Dao) UserClaims(u *User) jws.Claims + type Encryptor interface + Decode func(buf []byte) ([]byte, error) + Encode func(buf []byte) ([]byte, error) + Equal func(plain, code []byte) bool + Sum func(buf []byte) []byte + func NewAesHmacEncryptor(ck, hk []byte) (Encryptor, error) + type Engine struct + Cache *web.Cache + Dao *Dao + I18n *i18n.I18n + Jwt *Jwt + Logger *logging.Logger + Oauth2GoogleState string + func (p *Engine) Map(inj *inject.Graph) error + func (p *Engine) Migrate(db *gorm.DB) + func (p *Engine) Mount(r *gin.Engine) + func (p *Engine) Seed() + func (p *Engine) Shell() []cli.Command + func (p *Engine) Worker() + type GoogleCredential struct + Web struct{ ... } + func (p *GoogleCredential) To() oauth2.Config + type GoogleUser struct + Email string + ID string + Link string + Name string + Picture string + type Jwt struct + Dao *Dao + Key []byte + Logger *logging.Logger + Method crypto.SigningMethod + Redis *redis.Pool + 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 Log struct + CreatedAt time.Time + ID uint + Message string + User User + UserID uint + type Notice struct + Content string + CreatedAt time.Time + ID uint + Lang string + type NoticeFm struct + Content string + type OauthFm struct + Code string + State string + type Permission struct + Begin time.Time + End time.Time + Role Role + RoleID uint + User User + UserID uint + func (p *Permission) BeginS() string + func (p *Permission) Enable() bool + func (p *Permission) EndS() string + type Role struct + Name string + ResourceID uint + ResourceType string + func (p Role) String() string + type Setting struct + Flag bool + Key string + Val []byte + type User struct + ConfirmedAt *time.Time + Email string + Home string + LastSignIn *time.Time + LockedAt *time.Time + Logo string + Logs []Log + Name string + Password string + Permissions []Permission + ProviderID string + ProviderType string + SignInCount uint + UID string + func (p *User) IsAvailable() bool + func (p *User) IsConfirmed() bool + func (p *User) IsLocked() bool + func (p *User) SetGravatar() + func (p User) String() string