Versions in this module Expand all Collapse all v0 v0.1.0 Sep 19, 2017 Changes in this version + const DateFormat + const DefaultResourceID + const DefaultResourceType + const RoleAdmin + const RoleRoot + const TITLE + const UserTypeEmail + func AddLog(o orm.Ormer, user *User, ip, message string) error + func Allow(o orm.Ormer, user *User, role *Role, years, months, days int) error + func Authority(o orm.Ormer, user uint, rty string, rid uint) ([]string, error) + func Cache() cache.Cache + func Can(o orm.Ormer, user uint, name string, rty string, rid uint) bool + func CreateCertificate(ca bool, subject pkix.Name, years int) ([]byte, []byte, error) + func Deny(o orm.Ormer, role uint, user uint) error + func Get(k string, v interface{}) error + func GetLocale(lang, code string) (string, error) + func HTTPMethodFilter(ctx *context.Context) + func Is(o orm.Ormer, user uint, names ...string) bool + func ListResourcesIds(o orm.Ormer, user uint, role, rty string) ([]uint, error) + func ListUserByResource(o orm.Ormer, role, rty string, rid uint) ([]uint, error) + func LoadLocales() error + func Main(args ...string) error + func Open() error + func RegisterSitemap(args ...SitemapHandler) + func Set(o orm.Ormer, k string, v interface{}, e bool) error + func SetLocale(o orm.Ormer, lang, code, message string) error + func Te(lang, code string, args ...interface{}) error + func Th(lang, code string, obj interface{}) (string, error) + func Tr(lang, code string, args ...interface{}) string + func WritePemFile(file, _type string, buf []byte, mode os.FileMode) error + type Aes struct + func AES() *Aes + func (p *Aes) Decrypt(buf []byte) ([]byte, error) + func (p *Aes) Encrypt(buf []byte) ([]byte, 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 + func (*Attachment) TableName() string + func (p *Attachment) IsPicture() bool + type Card struct + Action string + CreatedAt time.Time + Href string + ID uint + Loc string + Logo string + SortOrder int + Summary string + Title string + Type string + UpdatedAt time.Time + func (*Card) TableName() string + type Controller struct + func (p *Controller) Abort(s int, e error) + func (p *Controller) AddDashboardMenu(label string, links ...Link) + func (p *Controller) CurrentUser() *User + func (p *Controller) Flash(fn func() string, er error) bool + func (p *Controller) HomeURL() string + func (p *Controller) IsAdmin() bool + func (p *Controller) LayoutApplication() + func (p *Controller) LayoutDashboard() + func (p *Controller) Locale() string + func (p *Controller) MustAdmin() + func (p *Controller) MustSignIn() + func (p *Controller) ParseForm(fm interface{}) error + func (p *Controller) Prepare() + func (p *Controller) Redirect(name string, args ...interface{}) + func (p *Controller) SetSortOrders() + func (p *Controller) UploadFile(name string) (*Attachment, error) + type ErrorController struct + func (p *ErrorController) Error404() + func (p *ErrorController) Error500() + type FriendLink struct + CreatedAt time.Time + Home string + ID uint + Logo string + SortOrder int + Title string + UpdatedAt time.Time + func (*FriendLink) TableName() string + type H map[string]interface + type Hmac struct + func HMAC() *Hmac + func (p *Hmac) Chk(plain, code []byte) bool + func (p *Hmac) Sum(plain []byte) []byte + type JobHandler func(body []byte) error + type Jobber struct + func JOBBER() *Jobber + func (p *Jobber) Receive(consumer string) error + func (p *Jobber) Register(n string, h JobHandler) + func (p *Jobber) Send(pri uint8, typ string, body []byte) error + type Jwt struct + func JWT() *Jwt + func (p *Jwt) Generate(cm jws.Claims, exp time.Duration) ([]byte, error) + func (p *Jwt) Parse(buf []byte) (jwt.Claims, error) + func (p *Jwt) ParseFromRequest(r *http.Request) (jwt.Claims, error) + type LeaveWord struct + Body string + CreatedAt time.Time + ID uint + Type string + func (*LeaveWord) TableName() string + type Link struct + CreatedAt time.Time + Href string + ID uint + Label string + Loc string + SortOrder int + UpdatedAt time.Time + func (*Link) TableName() string + type Locale struct + Code string + CreatedAt time.Time + ID uint + Lang string + Message string + UpdatedAt time.Time + func (*Locale) TableName() string + type Log struct + CreatedAt time.Time + ID uint + IP string + Message string + User *User + func (*Log) TableName() string + func (p Log) String() string + type Plugin struct + func (p *Plugin) CreateAdminCard() + func (p *Plugin) CreateAdminFriendLink() + func (p *Plugin) CreateAdminLink() + func (p *Plugin) CreateAdminLocale() + func (p *Plugin) CreateLeaveWord() + func (p *Plugin) DeleteUsersSignOut() + func (p *Plugin) DestroyAdminCard() + func (p *Plugin) DestroyAdminFriendLink() + func (p *Plugin) DestroyAdminLink() + func (p *Plugin) DestroyAdminLocale() + func (p *Plugin) DestroyAttachment() + func (p *Plugin) DestroyLeaveWord() + func (p *Plugin) EditAdminCard() + func (p *Plugin) EditAdminFriendLink() + func (p *Plugin) EditAdminLink() + func (p *Plugin) GetAdminSiteAuthor() + func (p *Plugin) GetAdminSiteInfo() + func (p *Plugin) GetAdminSiteSMTP() + func (p *Plugin) GetAdminSiteSeo() + func (p *Plugin) GetAdminSiteStatus() + func (p *Plugin) GetBaiduVerify() + func (p *Plugin) GetDashboard() + func (p *Plugin) GetGoogleVerify() + func (p *Plugin) GetHome() + func (p *Plugin) GetInstall() + func (p *Plugin) GetSitemap() + func (p *Plugin) GetUsersChangePassword() + func (p *Plugin) GetUsersConfirm() + func (p *Plugin) GetUsersConfirmToken() + func (p *Plugin) GetUsersForgotPassword() + func (p *Plugin) GetUsersLogs() + func (p *Plugin) GetUsersProfile() + func (p *Plugin) GetUsersResetPassword() + func (p *Plugin) GetUsersSignIn() + func (p *Plugin) GetUsersSignUp() + func (p *Plugin) GetUsersUnlock() + func (p *Plugin) GetUsersUnlockToken() + func (p *Plugin) IndexAdminCards() + func (p *Plugin) IndexAdminFriendLinks() + func (p *Plugin) IndexAdminLinks() + func (p *Plugin) IndexAdminLocales() + func (p *Plugin) IndexAdminUsers() + func (p *Plugin) IndexAttachments() + func (p *Plugin) IndexLeaveWords() + func (p *Plugin) NewAdminCard() + func (p *Plugin) NewAdminFriendLink() + func (p *Plugin) NewAdminLink() + func (p *Plugin) NewAdminLocale() + func (p *Plugin) NewLeaveWord() + func (p *Plugin) PostAdminSiteAuthor() + func (p *Plugin) PostAdminSiteFavicon() + func (p *Plugin) PostAdminSiteInfo() + func (p *Plugin) PostAdminSiteSMTP() + func (p *Plugin) PostAdminSiteSeo() + func (p *Plugin) PostAttachmentsUeditor() + func (p *Plugin) PostInstall() + func (p *Plugin) PostUsersChangePassword() + func (p *Plugin) PostUsersConfirm() + func (p *Plugin) PostUsersForgotPassword() + func (p *Plugin) PostUsersProfile() + func (p *Plugin) PostUsersResetPassword() + func (p *Plugin) PostUsersSignIn() + func (p *Plugin) PostUsersSignUp() + func (p *Plugin) PostUsersUnlock() + func (p *Plugin) UpdateAdminCard() + func (p *Plugin) UpdateAdminFriendLink() + func (p *Plugin) UpdateAdminLink() + type Policy struct + CreatedAt time.Time + ID uint + Role *Role + ShutDown time.Time + StartUp time.Time + UpdatedAt time.Time + User *User + func (*Policy) TableName() string + func (p *Policy) Enable() bool + type Role struct + CreatedAt time.Time + ID uint + Name string + ResourceID uint + ResourceType string + UpdatedAt time.Time + func GetRole(o orm.Ormer, name string, rty string, rid uint) (*Role, error) + func (*Role) TableName() string + func (p Role) String() string + type SMTP struct + Host string + Password string + Port int + Sender string + type Setting struct + CreatedAt time.Time + Encode bool + ID uint + Key string + UpdatedAt time.Time + Val string + func (*Setting) TableName() string + type SitemapHandler func() ([]string, error) + 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 + Name string + Password string + ProviderID string + ProviderType string + SignInCount uint + UID string + UpdatedAt time.Time + func AddEmailUser(o orm.Ormer, lang, ip, name, email, password string) (*User, error) + func GetUserByEmail(email string) (*User, error) + func GetUserByUID(uid string) (*User, error) + func SignIn(o orm.Ormer, lang, ip, 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 Vote struct + CreatedAt time.Time + ID uint + Point int + ResourceID uint + ResourceType string + UpdatedAt time.Time + func (*Vote) TableName() string