Documentation
¶
Index ¶
- Variables
- func Cleanup() (err error)
- func ContextWithSite(ctx context.Context, site string) context.Context
- func GenNewClient(name, redirectURI string) *oauth.Client
- func GenNewIID() string
- 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 SiteFromContext(ctx context.Context) string
- func SiteFromDomain(name string) string
- func SiteFromURL(uri string) string
- func StoreTeamAndStaffs(ctx context.Context, svc Servicer, team *team.Team, staffs models.Staffs) (err error)
- func WriteUserLog(uid, subject, message string) error
- type Client
- type ClientSpec
- type DbStorage
- func (s *DbStorage) Clone() osin.Storage
- func (s *DbStorage) Close()
- func (s *DbStorage) CountClients() (total uint)
- func (s *DbStorage) GetClient(id string) (c osin.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) LoadClient(id string) (*Client, 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) RemoveClient(id string) error
- func (s *DbStorage) RemoveRefresh(code string) error
- func (s *DbStorage) SaveAccess(data *osin.AccessData) (err 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 Group
- type JSONKV
- type LDAPConfig
- type OSINStore
- type PasswordStore
- type PoolStats
- type Servicer
- type Spec
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") ErrEmptyEmail = errors.New("email is empty") )
View Source
var (
ErrStoreNotFound = ldap.ErrNotFound
)
vars
View Source
var (
ToJSONKV = oauth.ToJSONKV
)
vars
Functions ¶
func ContextWithSite ¶ added in v0.12.6
func GenNewClient ¶ added in v0.12.0
GenNewClient ...
func SaveArticle ¶
func SetPasswordSecret ¶ added in v0.10.0
func SetPasswordSecret(s string)
func SiteFromContext ¶ added in v0.12.6
func SiteFromDomain ¶ added in v0.12.6
func SiteFromURL ¶ added in v0.12.6
func StoreTeamAndStaffs ¶ added in v0.12.0
func StoreTeamAndStaffs(ctx context.Context, svc Servicer, team *team.Team, staffs models.Staffs) (err error)
StoreTeamAndStaffs = svc.SaveTeamAndStaffs
func WriteUserLog ¶
Types ¶
type ClientSpec ¶ added in v0.12.0
type ClientSpec = oauth.ClientSpec
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) 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) LoadClient ¶ added in v0.12.0
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) RemoveClient ¶ added in v0.12.0
func (*DbStorage) RemoveRefresh ¶
func (*DbStorage) SaveAccess ¶
func (s *DbStorage) SaveAccess(data *osin.AccessData) (err error)
func (*DbStorage) SaveAuthorize ¶
func (s *DbStorage) SaveAuthorize(data *osin.AuthorizeData) error
func (*DbStorage) SaveAuthorized ¶ added in v0.6.3
type PasswordStore ¶ added in v0.12.6
type Servicer ¶ added in v0.6.3
type Servicer interface {
schema.Authenticator
schema.PeopleStore
schema.GroupStore
PasswordStore
cas.TicketStore
OSIN() OSINStore
Ready() error
CloseAll()
SaveStaff(ctx context.Context, staff *models.Staff) error
SaveTeamAndStaffs(ctx context.Context, team *team.Team, staffs models.Staffs) (err error)
InGroup(gn, uid string) bool
InGroupAny(uid string, names ...string) bool
ProfileModify(uid, password string, staff *models.Staff) error
Team() team.Store
Watch() team.WatchStore
Weekly() weekly.Store
PoolStats() *PoolStats
}
Servicer ...
Source Files
¶
Click to show internal directories.
Click to hide internal directories.