Documentation ¶
Index ¶
- Constants
- Variables
- func DownloadConfigFile(fname string) (err error)
- func InArrayStr(s string, arr []string) bool
- func LoadJSONConfig(filename string, v interface{}) error
- func SendSMTPMail(mailAddress string, subject string, body string) error
- func UnescapeUnicode(raw []byte) ([]byte, error)
- type Config
- type Liupai
- type ParseCaptchaInterface
- type RuanKao
- func (this *RuanKao) GetCaptchaCode(parseCaptchaInterface ParseCaptchaInterface) (captchaCode string, err error)
- func (this *RuanKao) GetExaminationTimeList() (list []string, err error)
- func (this *RuanKao) GetScore(ruanKaoUser RuanKaoUser) (scoreRes *ScoreRes, err error)
- func (this *RuanKao) SetWelComeCookie() (err error)
- func (this *RuanKao) VerifyCaptchaUri(captcha string) (err error)
- type RuanKaoUser
- type ScoreRes
Constants ¶
View Source
const ( // 邮件服务器地址 SMTP_MAIL_HOST = "smtp.126.com" // 端口 SMTP_MAIL_PORT = "25" )
View Source
const LiuPaiCommand = 1
Variables ¶
View Source
var ( // 发送邮件用户账号 126邮箱 SMTP_MAIL_USER = "" // 授权密码 SMTP_MAIL_PWD = "" )
Functions ¶
func LoadJSONConfig ¶
LoadJSONConfig 读取配置文件 json格式
Types ¶
type Config ¶
type Config struct { Year string `json:"year" validate:"required"` Name string `json:"name" validate:"required"` IdCard string `json:"id_card" validate:"required"` Appsecret string `json:"appsecret" validate:"required"` SendUser163MailAddress string `json:"send_user_163_mail_address" validate:"required"` SendUser163MailAuthCode string `json:"send_user_163_mail_auth_code" validate:"required"` ReceiveUser163MailAddress string `json:"receive_user_163_mail_address" validate:"required"` TimeInterval int `json:"time_interval"` }
配置
type ParseCaptchaInterface ¶
type ParseCaptchaInterface interface { //通过验证码图片的base64得到验证码code GetCaptchaRes(captchaBase64 string) (captchaRes string, err error) }
解析验证码接口
func ParseCaptchaCommand ¶
func ParseCaptchaCommand(command int, config map[string]interface{}) (ParseCaptchaInterface, error)
根据命令释放对应的对象
type RuanKao ¶
type RuanKao struct {
// contains filtered or unexported fields
}
软考结构体
func (*RuanKao) GetCaptchaCode ¶
func (this *RuanKao) GetCaptchaCode(parseCaptchaInterface ParseCaptchaInterface) (captchaCode string, err error)
获取验证码
func (*RuanKao) GetExaminationTimeList ¶
获取所有考试时间
func (*RuanKao) GetScore ¶
func (this *RuanKao) GetScore(ruanKaoUser RuanKaoUser) (scoreRes *ScoreRes, err error)
获取分数
func (*RuanKao) VerifyCaptchaUri ¶
验证验证码
Source Files ¶
Click to show internal directories.
Click to hide internal directories.