Documentation
¶
Index ¶
- Constants
- Variables
- type IdCardFront
- type MGAi
- func (mg *MGAi) GetAccessToken() (token string, err error)
- func (mg *MGAi) GetAsrAccessToken() (token string, err error)
- func (mg *MGAi) IdCardFront(image, accessToken string) (idCardFront *IdCardFront, err error)
- func (mg *MGAi) Speech(speechData string, speechDataLen int64, format, token string) (content string, err error)
Constants ¶
View Source
const ( AccessTokenURL = "https://aip.baidubce.com/oauth/2.0/token" AsrAccessTokenURL = "https://openapi.baidu.com/oauth/2.0/token" IDCardURL = "https://aip.baidubce.com/rest/2.0/ocr/v1/idcard" AsrSpeedURL = "http://vop.baidu.com/server_api" )
View Source
const ( ReturnErrorCodeKey = "errors" ReturnErrorMsgKey = "error_description" ReturnAccessTokenKey = "access_token" ReturnWordsResultKey = "words_result" ReturnResultKey = "result" )
View Source
const (
AreaCode = `` /* 123311-byte string literal not displayed */
)
Variables ¶
View Source
var ( MxAIParamError = errors.New("request param errors") VoiceRate16000 = 16000 ContentTypeUrlencoded = "application/x-www-form-urlencoded" ContentTypeJson = "application/json;charset=utf-8" )
View Source
var ( ErrIDCardInfoEmpty = errors.New("idCard info empty") ErrAsrFailure = errors.New("asr failure") )
Functions ¶
This section is empty.
Types ¶
type IdCardFront ¶
type MGAi ¶
func (*MGAi) GetAccessToken ¶
获取 Access Token
func (*MGAi) GetAsrAccessToken ¶
获取 Access Token
func (*MGAi) IdCardFront ¶
func (mg *MGAi) IdCardFront(image, accessToken string) (idCardFront *IdCardFront, err error)
身份证(正面)识别 image-必填,图像数据,base64编码后进行urlencode,要求base64编码和urlencode后大小不超过4M,最短边至少15px,最长边最大4096px,支持jpg/png/bmp格式
Click to show internal directories.
Click to hide internal directories.