xfaceprint

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2023 License: BSD-3-Clause-Clear Imports: 9 Imported by: 0

Documentation

Overview

百度人脸识别/人脸认证SDK

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAccessToken

func GetAccessToken() string

获取百度AI中心的token标识

func GetResultSimple

func GetResultSimple(verify_token string) (string, error)

获取认证图片

verify_token	识别token

func GetVerifyToken

func GetVerifyToken() string

获取百度鉴权的verify_token

func Regedit

func Regedit(c *Config)

配置项注入

func SwitchPlanId

func SwitchPlanId(plan_id string)

切换plan_id

plan_id	方案的id信息,请在人脸实名认证控制台查看创建的H5方案的方案ID信息

Types

type Config

type Config struct {
	Domain    string // 人脸识别接口域名
	AppId     string // 百度开发者平台的AppId
	AppKey    string // 百度开发者平台的AK
	SecretKey string // 百度开发者平台的密钥信息
	PlanId    string // 获取鉴权ID
}

百度人脸识别配置项

type IdCardSubmitStruct

type IdCardSubmitStruct struct {
	SuccessUrl  string `json:"success_url" form:"success_url"`   // 成功的回跳地址
	ErrorUrl    string `json:"error_url" form:"error_url"`       // 失败的回跳地址
	H5Url       string `json:"h5_url" form:"h5_url"`             // 认证H5地址
	VerifyToken string `json:"verify_token" form:"verify_token"` // 请求批次
}

func IdcardSubmit

func IdcardSubmit(id_name, id_no string, c_type uint, suc_url, err_url string) (*IdCardSubmitStruct, error)

用户信息提交接口

id_name	姓名
id_no	身份证号
c_type	身份证类型 0-大陆居民二代身份证 4-港澳台居民居住证
suc_url	成功后的跳转地址,会自动追加&verify_token=xxxxx,所以若地址为绝对地址时请追加?
err_url	成功后的跳转地址,会自动追加&verify_token=xxxxx,所以若地址为绝对地址时请追加?

type ResultDetailResult

type ResultDetailResult struct {
	VerifyResult    ResultDetailResultVerifyResult    `json:"verify_result" form:"verify_result"`
	IdcardOcrResult ResultDetailResultIdcardOcrResult `json:"idcard_ocr_result" form:"idcard_ocr_result"`
	IdcardImages    ResultDetailResultIdcardImages    `json:"idcard_images" form:"idcard_images"`
	IdcardConfirm   ResultDetailResultIdcardConfirm   `json:"idcard_confirm" form:"idcard_confirm"`
}

func GetResultDetail

func GetResultDetail(verify_token string) (*ResultDetailResult, error)

获取认证结果

verify_token	识别token

type ResultDetailResultIdcardConfirm

type ResultDetailResultIdcardConfirm struct {
	IdcardNumber string `json:"idcard_number" form:"idcard_number"`
	Name         string `json:"name" form:"name"`
}

type ResultDetailResultIdcardImages

type ResultDetailResultIdcardImages struct {
	FrontBase64 string `json:"front_base64" form:"front_base64"`
	BackBase64  string `json:"back_base64" form:"back_base64"`
}

type ResultDetailResultIdcardOcrResult

type ResultDetailResultIdcardOcrResult struct {
	IssueAuthority string `json:"issue_authority" form:"issue_authority"`
	Address        string `json:"address" form:"address"`
	Nation         string `json:"nation" form:"nation"`
	ExpireTime     string `json:"expire_time" form:"expire_time"`
	Name           string `json:"name" form:"name"`
	IssueTime      string `json:"issue_time" form:"issue_time"`
	IdCardNumber   string `json:"id_card_number" form:"id_card_number"`
	Birthday       string `json:"birthday" form:"birthday"`
	Gender         string `json:"gender" form:"gender"`
}

type ResultDetailResultVerifyResult

type ResultDetailResultVerifyResult struct {
	LivenessScore json.Number `json:"liveness_score" form:"liveness_score"`
	Spoofing      json.Number `json:"spoofing" form:"spoofing"`
	Score         json.Number `json:"score" form:"score"`
}

Jump to

Keyboard shortcuts

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