Documentation ¶
Index ¶
- Variables
- func CheckMailUnseen(uid string) int
- func Cleanup() (err error)
- func GetEmailAddress(uid string) string
- func GetMailEntryUrl(uid string) string
- func GetStaffFromExmail(email string) (*models.Staff, error)
- func GetStaffFromWechatUser(user *exwechat.User) *models.Staff
- func LoadArticle(id int) (*content.Article, error)
- func LoadArticles(limit, offset int) (data []*content.Article, err error)
- func LoadLink(id int) (*content.Link, error)
- func LoadLinks(limit, offset int) (data []*content.Link, err error)
- func NextStaffID() (eid int, err error)
- func SaveArticle(a *content.Article) error
- func SaveLink(l *content.Link) error
- func SetDSN(dsn string)
- func SetLDAP(c LDAPConfig)
- func SetPasswordSecret(s string)
- func SetupSMTPAuth(from, password string)
- func SetupSMTPHost(host string, port int)
- func WriteUserLog(uid, subject, message string) error
- type DbStorage
- func (s *DbStorage) Clone() osin.Storage
- func (s *DbStorage) Close()
- func (s *DbStorage) CountClients() (total uint)
- func (s *DbStorage) GetClient(id string) (osin.Client, error)
- func (s *DbStorage) GetClientWithCode(code string) (c *oauth.Client, err error)
- func (s *DbStorage) GetClientWithID(id int) (c *oauth.Client, err error)
- func (s *DbStorage) IsAuthorized(clientId, username string) bool
- func (s *DbStorage) LoadAccess(code string) (*osin.AccessData, error)
- func (s *DbStorage) LoadAuthorize(code string) (*osin.AuthorizeData, error)
- func (s *DbStorage) LoadClients(spec *oauth.ClientSpec) (clients []oauth.Client, err error)
- func (s *DbStorage) LoadRefresh(code string) (*osin.AccessData, error)
- func (s *DbStorage) LoadScopes() (scopes []oauth.Scope, err error)
- func (s *DbStorage) RemoveAccess(code string) error
- func (s *DbStorage) RemoveAuthorize(code string) error
- func (s *DbStorage) RemoveRefresh(code string) error
- func (s *DbStorage) SaveAccess(data *osin.AccessData) error
- func (s *DbStorage) SaveAuthorize(data *osin.AuthorizeData) error
- func (s *DbStorage) SaveAuthorized(clientId, username string) error
- func (s *DbStorage) SaveClient(client *oauth.Client) error
- type LDAPConfig
- type OSINStore
- type PoolStats
- type Servicer
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrEmptyVal = errors.New("empty value") ErrNotFound = errors.New("Not Found") ErrNoRows = sql.ErrNoRows )
View Source
var ( ErrInvalidResetToken = errors.New("invalid reset token or not found") ErrMailNotReady = errors.New("email system is not ready") )
View Source
var ( MailSenderName = "Notification" BaseURL string )
View Source
var (
EmailDomain string
)
View Source
var (
ErrStoreNotFound = ldap.ErrNotFound
)
Functions ¶
func CheckMailUnseen ¶
func GetEmailAddress ¶
func GetMailEntryUrl ¶
func GetStaffFromWechatUser ¶ added in v0.8.13
func SaveArticle ¶
func SetLDAP ¶ added in v0.10.0
func SetLDAP(c LDAPConfig)
func SetPasswordSecret ¶ added in v0.10.0
func SetPasswordSecret(s string)
func SetupSMTPAuth ¶ added in v0.9.0
func SetupSMTPAuth(from, password string)
func SetupSMTPHost ¶ added in v0.10.0
func WriteUserLog ¶
Types ¶
type DbStorage ¶
type DbStorage struct {
// contains filtered or unexported fields
}
func NewStorage ¶
func NewStorage() *DbStorage
func (*DbStorage) CountClients ¶ added in v0.6.3
func (*DbStorage) GetClientWithCode ¶ added in v0.6.3
func (*DbStorage) GetClientWithID ¶ added in v0.9.0
func (*DbStorage) IsAuthorized ¶ added in v0.6.3
func (*DbStorage) LoadAccess ¶
func (s *DbStorage) LoadAccess(code string) (*osin.AccessData, error)
func (*DbStorage) LoadAuthorize ¶
func (s *DbStorage) LoadAuthorize(code string) (*osin.AuthorizeData, error)
func (*DbStorage) LoadClients ¶ added in v0.6.3
func (*DbStorage) LoadRefresh ¶
func (s *DbStorage) LoadRefresh(code string) (*osin.AccessData, error)
func (*DbStorage) LoadScopes ¶ added in v0.6.3
func (*DbStorage) RemoveAccess ¶
func (*DbStorage) RemoveAuthorize ¶
func (*DbStorage) RemoveRefresh ¶
func (*DbStorage) SaveAccess ¶
func (s *DbStorage) SaveAccess(data *osin.AccessData) error
func (*DbStorage) SaveAuthorize ¶
func (s *DbStorage) SaveAuthorize(data *osin.AuthorizeData) error
func (*DbStorage) SaveAuthorized ¶ added in v0.6.3
type LDAPConfig ¶ added in v0.10.0
type Servicer ¶ added in v0.6.3
type Servicer interface { models.Authenticator models.StaffStore models.PasswordStore models.GroupStore cas.TicketStore OSIN() OSINStore Ready() error CloseAll() SaveStaff(staff *models.Staff) error InGroup(gn, uid string) bool InGroupAny(uid string, names ...string) bool ProfileModify(uid, password string, staff *models.Staff) error PasswordForgot(at common.AliasType, target, uid string) error PasswordResetTokenVerify(token string) (uid string, err error) PasswordResetWithToken(login, token, passwd string) (err error) Team() weekly.TeamStore Weekly() weekly.WeeklyStore PoolStats() *PoolStats }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.