backends

package
v0.8.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 10, 2019 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ASCENDING  = 1
	DESCENDING = -1
)

Variables

View Source
var (
	ErrNotFound = errors.New("Not Found")

	ErrNoRows = sql.ErrNoRows
)
View Source
var (
	ErrInvalidResetToken = errors.New("invalid reset token or not found")
)

Functions

func CheckMailUnseen

func CheckMailUnseen(uid string) int

func Cleanup

func Cleanup() (err error)

清理过期的数据

func GetEmailAddress

func GetEmailAddress(uid string) string

func GetMailEntryUrl

func GetMailEntryUrl(uid string) string

func GetStaffFromExmail

func GetStaffFromExmail(email string) (*models.Staff, error)

func InitSMTP added in v0.6.9

func InitSMTP()

func LoadArticle

func LoadArticle(id int) (*models.Article, error)

func LoadArticles

func LoadArticles(limit, offset int) (data []*models.Article, err error)
func LoadLink(id int) (*models.Link, error)
func LoadLinks(limit, offset int) (data []*models.Link, err error)

func NextStaffID added in v0.8.2

func NextStaffID() (eid int, err error)

返回下一个员工ID

func SaveArticle

func SaveArticle(a *models.Article) error
func SaveLink(l *models.Link) error

func WriteUserLog

func WriteUserLog(uid, subject, message string) error

Types

type DbStorage

type DbStorage struct {
	// contains filtered or unexported fields
}

func NewStorage

func NewStorage() *DbStorage

func (*DbStorage) Clone

func (s *DbStorage) Clone() osin.Storage

func (*DbStorage) Close

func (s *DbStorage) Close()

func (*DbStorage) CountClients added in v0.6.3

func (s *DbStorage) CountClients() (total uint)

func (*DbStorage) GetClient

func (s *DbStorage) GetClient(id string) (osin.Client, error)

func (*DbStorage) GetClientWithCode added in v0.6.3

func (s *DbStorage) GetClientWithCode(code string) (*models.Client, error)

func (*DbStorage) IsAuthorized added in v0.6.3

func (s *DbStorage) IsAuthorized(client_id, username string) bool

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 (s *DbStorage) LoadClients(limit, offset int, sort map[string]int) (clients []*models.Client, err error)

func (*DbStorage) LoadRefresh

func (s *DbStorage) LoadRefresh(code string) (*osin.AccessData, error)

func (*DbStorage) LoadScopes added in v0.6.3

func (s *DbStorage) LoadScopes() (scopes []*models.Scope, err error)

func (*DbStorage) RemoveAccess

func (s *DbStorage) RemoveAccess(code string) error

func (*DbStorage) RemoveAuthorize

func (s *DbStorage) RemoveAuthorize(code string) error

func (*DbStorage) RemoveRefresh

func (s *DbStorage) RemoveRefresh(code string) error

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

func (s *DbStorage) SaveAuthorized(client_id, username string) error

func (*DbStorage) SaveClient added in v0.6.3

func (s *DbStorage) SaveClient(client *models.Client) error

type OSINStore added in v0.6.3

type OSINStore interface {
	osin.Storage
	LoadClients(limit, offset int, sort map[string]int) ([]*models.Client, error)
	CountClients() uint
	GetClientWithCode(code string) (*models.Client, error)
	SaveClient(client *models.Client) error
	LoadScopes() (scopes []*models.Scope, err error)
	IsAuthorized(client_id, username string) bool
	SaveAuthorized(client_id, username string) error
}

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
	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
}

func NewService

func NewService() Servicer

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL