chaojiying_sdk

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2020 License: MIT Imports: 10 Imported by: 0

README

Install

go get github.com/caijunduo/chaojiying-sdk

Example

package main

import (
    cjySdk "github.com/caijunduo/chaojiying-sdk"
    "log"
)

func main () {
    // 获取用户题分
    cjy := cjySdk.NewChaoJiYing()
    userInfo, err := cjy.UserInfo()
    if err != nil {
        log.Fatal(err)
    }
    log.Printf("tifen: %d, lock_tifen: %d", userInfo.TiFen, userInfo.TiFenLock)
}

API

超级鹰文档:https://www.chaojiying.com/api-5.html

获取用户题分
cjySdk.NewChaoJiYing().UserInfo()
识别图片
cjySdk.NewChaoJiYing().IdentifyPic(codeType int, minLen int, imgBase64 string)
提交识别错误并返回题分
cjySdk.NewChaoJiYing().ReportError(picId string)
设置HTTPS代理
cjySdk.NewChaoJiYing().SetHttpsProxy(u string)
设置超时时间(秒)
cjySdk.NewChaoJiYing().SetTimeout(t time.Duration)
设置超级鹰用户账号,如设置环境变量:CHAOJIYING_USER 则默认获取环境变量
cjySdk.NewChaoJiYing().SetUser(user string)
设置超级鹰用户密码,如设置环境变量:CHAOJIYING_PASS 则默认获取环境变量
cjySdk.NewChaoJiYing().SetPass(pass string)
设置超级鹰用户密码的MD5值,如设置环境变量:CHAOJIYING_PASS2 则默认获取环境变量
cjySdk.NewChaoJiYing().SetPass2(pass2 string)
设置超级鹰软件ID,如设置环境变量:CHAOJIYING_SOFT_ID 则默认获取环境变量
cjySdk.NewChaoJiYing().SetSoftId(softId string)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChaoJiYing

type ChaoJiYing interface {
	UserInfo() (userInfo *userInfoResp, err error) // Get User info
	IdentifyPic(
		codeType int,
		minLen int,
		imgBase64 string,
	) (
		identifyPic *identifyPicResp,
		err error,
	) // Identify pictures
	ReportError(picId string) (
		reportError *reportErrorResp,
		err error,
	) // Error report and return to score
	SetHttpsProxy(u string)     // Set Https Proxy
	SetTimeout(t time.Duration) // Set timeout (seconds)
	SetUser(user string)        // Set User account
	SetPass(pass string)        // Set User password
	SetPass2(pass2 string)      // Set DM5 value of user password (32-bit lower case)
	SetSoftId(softId string)    // Set Software ID: in the user center, the software ID can be generated
}

IChaoJiYing ChaoJiYing sdk open interface

func NewChaoJiYing

func NewChaoJiYing() ChaoJiYing

NewChaoJiYing

Jump to

Keyboard shortcuts

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