Documentation ¶
Index ¶
- type AuthEngine
- type Dao
- func (p *Dao) Allow(role uint, user uint, dur time.Duration) error
- func (p *Dao) Can(user uint, name string, resource_type string, resource_id uint) bool
- func (p *Dao) Deny(role uint, user uint) error
- func (p *Dao) GetUser(uid string) (*User, error)
- func (p *Dao) Is(user uint, name string) bool
- func (p *Dao) ListUser() []User
- func (p *Dao) Log(user uint, message string) error
- func (p *Dao) Role(name string, resource_type string, resource_id uint) (*Role, error)
- func (p *Dao) SaveUser(pty, pid, email, name, home, logo string) (*User, error)
- type EmailForm
- type Google
- type GoogleConf
- type GoogleUserInfo
- type GoogleWeb
- type Log
- type Oauth
- type PasswordForm
- type Permission
- type Role
- type Session
- type SignInForm
- type SignUpForm
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthEngine ¶
type AuthEngine struct { core.Controller SiteDao *site.Dao `inject:""` Db *gorm.DB `inject:""` Dao *Dao `inject:""` Cfg *config.Model `inject:""` Token token.Provider `inject:""` Render *render.Render `inject:""` Session *Session `inject:""` }
func (*AuthEngine) Asserts ¶
func (p *AuthEngine) Asserts() []*core.Template
func (*AuthEngine) Migrate ¶
func (p *AuthEngine) Migrate()
func (*AuthEngine) Mount ¶
func (p *AuthEngine) Mount(rt core.Router)
func (*AuthEngine) Rss ¶
func (p *AuthEngine) Rss() rss.Handler
func (*AuthEngine) Seed ¶
func (p *AuthEngine) Seed() error
func (*AuthEngine) Shell ¶
func (p *AuthEngine) Shell() []cli.Command
func (*AuthEngine) Sitemap ¶
func (p *AuthEngine) Sitemap() sitemap.Handler
type Google ¶
type Google struct {
// contains filtered or unexported fields
}
func NewGoogle ¶
func NewGoogle(cfg *GoogleConf) *Google
===============================================
type GoogleConf ¶
type GoogleConf struct {
Web GoogleWeb `json:"web"`
}
type GoogleUserInfo ¶
type PasswordForm ¶
type Permission ¶
type Permission struct { ID uint `gorm:"primary_key"` User User UserID uint `sql:"not null"` Role Role RoleID uint `sql:"not null"` Begin time.Time `sql:"not null;default:current_date;type:date"` End time.Time `sql:"not null;default:'1000-1-1';type:date"` }
func (*Permission) BeginS ¶
func (p *Permission) BeginS() string
func (*Permission) Enable ¶
func (p *Permission) Enable() bool
func (*Permission) EndS ¶
func (p *Permission) EndS() string
type Role ¶
type Session ¶
type SignInForm ¶
type SignUpForm ¶
type User ¶
type User struct { core.Model Email string `sql:"not null;index:idx_users_email"` Uid string `sql:"not null;unique_index;type:char(36)"` Home string `sql:"not null"` Logo string `sql:"not null"` Name string `sql:"not null"` ProviderType string `sql:"not null;default:'unknown';index:idx_users_provider_type"` ProviderId string `sql:"not null;index:idx_users_provider_id"` LastSignIn time.Time `sql:"not null"` SignInCount uint `sql:"not null;default:0"` Permissions []Permission }
func (*User) SetGravatar ¶
func (p *User) SetGravatar()
Click to show internal directories.
Click to hide internal directories.