Documentation ¶
Index ¶
- type CaptchaRepo
- type CaptchaService
- func (cs *CaptchaService) ActionRecord(ctx context.Context, req *schema.ActionRecordReq) (resp *schema.ActionRecordResp, err error)
- func (cs *CaptchaService) ActionRecordAdd(ctx context.Context, actionType string, unit string) (int, error)
- func (cs *CaptchaService) ActionRecordDel(ctx context.Context, actionType string, unit string)
- func (cs *CaptchaService) ActionRecordVerifyCaptcha(ctx context.Context, actionType string, unit string, id string, ...) bool
- func (cs *CaptchaService) CaptchaActionAnswer(ctx context.Context, unit string, actioninfo *entity.ActionRecordInfo) bool
- func (cs *CaptchaService) CaptchaActionComment(ctx context.Context, unit string, actioninfo *entity.ActionRecordInfo) bool
- func (cs *CaptchaService) CaptchaActionDelete(ctx context.Context, unit string, actioninfo *entity.ActionRecordInfo) bool
- func (cs *CaptchaService) CaptchaActionEdit(ctx context.Context, unit string, actioninfo *entity.ActionRecordInfo) bool
- func (cs *CaptchaService) CaptchaActionEditUserinfo(ctx context.Context, unit string, actioninfo *entity.ActionRecordInfo) bool
- func (cs *CaptchaService) CaptchaActionEmail(ctx context.Context, unit string, actioninfo *entity.ActionRecordInfo) bool
- func (cs *CaptchaService) CaptchaActionInvitationAnswer(ctx context.Context, unit string, actioninfo *entity.ActionRecordInfo) bool
- func (cs *CaptchaService) CaptchaActionPassword(ctx context.Context, unit string, actioninfo *entity.ActionRecordInfo) bool
- func (cs *CaptchaService) CaptchaActionQuestion(ctx context.Context, unit string, actioninfo *entity.ActionRecordInfo) bool
- func (cs *CaptchaService) CaptchaActionReport(ctx context.Context, unit string, actioninfo *entity.ActionRecordInfo) bool
- func (cs *CaptchaService) CaptchaActionSearch(ctx context.Context, unit string, actioninfo *entity.ActionRecordInfo) bool
- func (cs *CaptchaService) CaptchaActionVote(ctx context.Context, unit string, actioninfo *entity.ActionRecordInfo) bool
- func (cs *CaptchaService) GenerateCaptcha(ctx context.Context) (key, captchaBase64 string, err error)
- func (cs *CaptchaService) UserRegisterCaptcha(ctx context.Context) (resp *schema.ActionRecordResp, err error)
- func (cs *CaptchaService) UserRegisterVerifyCaptcha(ctx context.Context, id string, VerifyValue string) bool
- func (cs *CaptchaService) ValidationStrategy(ctx context.Context, unit, actionType string) bool
- func (cs *CaptchaService) VerifyCaptcha(ctx context.Context, key, captcha string) (isCorrect bool, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CaptchaRepo ¶
type CaptchaRepo interface { SetCaptcha(ctx context.Context, key, captcha string) (err error) GetCaptcha(ctx context.Context, key string) (captcha string, err error) DelCaptcha(ctx context.Context, key string) (err error) SetActionType(ctx context.Context, unit, actionType, config string, amount int) (err error) GetActionType(ctx context.Context, unit, actionType string) (actioninfo *entity.ActionRecordInfo, err error) DelActionType(ctx context.Context, unit, actionType string) (err error) }
CaptchaRepo captcha repository
type CaptchaService ¶
type CaptchaService struct {
// contains filtered or unexported fields
}
CaptchaService kit service
func NewCaptchaService ¶
func NewCaptchaService(captchaRepo CaptchaRepo) *CaptchaService
NewCaptchaService captcha service
func (*CaptchaService) ActionRecord ¶
func (cs *CaptchaService) ActionRecord(ctx context.Context, req *schema.ActionRecordReq) (resp *schema.ActionRecordResp, err error)
ActionRecord action record
func (*CaptchaService) ActionRecordAdd ¶
func (*CaptchaService) ActionRecordDel ¶
func (cs *CaptchaService) ActionRecordDel(ctx context.Context, actionType string, unit string)
func (*CaptchaService) ActionRecordVerifyCaptcha ¶
func (cs *CaptchaService) ActionRecordVerifyCaptcha( ctx context.Context, actionType string, unit string, id string, VerifyValue string, ) bool
ActionRecordVerifyCaptcha Verify that you need to enter a CAPTCHA, and that the CAPTCHA is correct
func (*CaptchaService) CaptchaActionAnswer ¶
func (cs *CaptchaService) CaptchaActionAnswer(ctx context.Context, unit string, actioninfo *entity.ActionRecordInfo) bool
func (*CaptchaService) CaptchaActionComment ¶
func (cs *CaptchaService) CaptchaActionComment(ctx context.Context, unit string, actioninfo *entity.ActionRecordInfo) bool
func (*CaptchaService) CaptchaActionDelete ¶
func (cs *CaptchaService) CaptchaActionDelete(ctx context.Context, unit string, actioninfo *entity.ActionRecordInfo) bool
func (*CaptchaService) CaptchaActionEdit ¶
func (cs *CaptchaService) CaptchaActionEdit(ctx context.Context, unit string, actioninfo *entity.ActionRecordInfo) bool
func (*CaptchaService) CaptchaActionEditUserinfo ¶
func (cs *CaptchaService) CaptchaActionEditUserinfo(ctx context.Context, unit string, actioninfo *entity.ActionRecordInfo) bool
func (*CaptchaService) CaptchaActionEmail ¶
func (cs *CaptchaService) CaptchaActionEmail(ctx context.Context, unit string, actioninfo *entity.ActionRecordInfo) bool
func (*CaptchaService) CaptchaActionInvitationAnswer ¶
func (cs *CaptchaService) CaptchaActionInvitationAnswer(ctx context.Context, unit string, actioninfo *entity.ActionRecordInfo) bool
func (*CaptchaService) CaptchaActionPassword ¶
func (cs *CaptchaService) CaptchaActionPassword(ctx context.Context, unit string, actioninfo *entity.ActionRecordInfo) bool
func (*CaptchaService) CaptchaActionQuestion ¶
func (cs *CaptchaService) CaptchaActionQuestion(ctx context.Context, unit string, actioninfo *entity.ActionRecordInfo) bool
func (*CaptchaService) CaptchaActionReport ¶
func (cs *CaptchaService) CaptchaActionReport(ctx context.Context, unit string, actioninfo *entity.ActionRecordInfo) bool
func (*CaptchaService) CaptchaActionSearch ¶
func (cs *CaptchaService) CaptchaActionSearch(ctx context.Context, unit string, actioninfo *entity.ActionRecordInfo) bool
func (*CaptchaService) CaptchaActionVote ¶
func (cs *CaptchaService) CaptchaActionVote(ctx context.Context, unit string, actioninfo *entity.ActionRecordInfo) bool
func (*CaptchaService) GenerateCaptcha ¶
func (cs *CaptchaService) GenerateCaptcha(ctx context.Context) (key, captchaBase64 string, err error)
GenerateCaptcha generate captcha
func (*CaptchaService) UserRegisterCaptcha ¶
func (cs *CaptchaService) UserRegisterCaptcha(ctx context.Context) (resp *schema.ActionRecordResp, err error)
func (*CaptchaService) UserRegisterVerifyCaptcha ¶
func (*CaptchaService) ValidationStrategy ¶
func (cs *CaptchaService) ValidationStrategy(ctx context.Context, unit, actionType string) bool
ValidationStrategy true pass false need captcha
func (*CaptchaService) VerifyCaptcha ¶
func (cs *CaptchaService) VerifyCaptcha(ctx context.Context, key, captcha string) (isCorrect bool, err error)
VerifyCaptcha generate captcha
Click to show internal directories.
Click to hide internal directories.