huoshan

package
v0.0.0-...-768d9e2 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Path    = "/" // 路径,不包含 Query
	Region  = "cn-beijing"
	Version = "2018-01-01"
)

Variables

This section is empty.

Functions

func F保存base64图片

func F保存base64图片(filename string, imageData string) error

Types

type AssumeRoleRequest

type AssumeRoleRequest struct {
	DurationSeconds int
	Policy          string
	RoleTrn         string
	RoleSessionName string
}

type AssumeRoleResp

type AssumeRoleResp struct {
	ResponseMetadata ResponseMetadata
	Result           *AssumeRoleResult `json:",omitempty"`
}

type AssumeRoleResult

type AssumeRoleResult struct {
	Credentials     *Credentials
	AssumedRoleUser *AssumeRoleUser
}

type AssumeRoleUser

type AssumeRoleUser struct {
	Trn           string
	AssumedRoleId string
}

type CertConfigInitData

type CertConfigInitData struct {
	AlgorithmBaseResp *struct {
		StatusCode    int    `json:"status_code"`
		StatusMessage string `json:"status_message"`
	} `json:"algorithm_base_resp"`
	BinaryDataBase64 []string `json:"binary_data_base64"`
	ConfigId         string   `json:"config_id"`
}

type CertConfigInitResult

type CertConfigInitResult struct {
	RequestId   string              `json:"request_id"`
	Code        int                 `json:"code"`
	Message     string              `json:"message"`
	Status      int                 `json:"status"`
	TimeElapsed string              `json:"time_elapsed"`
	Data        *CertConfigInitData `json:"data"`
}

type CertTokenData

type CertTokenData struct {
	AlgorithmBaseResp *struct {
		StatusCode    int    `json:"status_code"`
		StatusMessage string `json:"status_message"`
	} `json:"algorithm_base_resp"`
	BinaryDataBase64 []string `json:"binary_data_base64"`
	BytedToken       string   `json:"byted_token"`
	ClientConfig     string   `json:"client_config"`
}

type CertTokenResult

type CertTokenResult struct {
	RequestId   string         `json:"request_id"`
	Code        int            `json:"code"`
	Message     string         `json:"message"`
	Status      int            `json:"status"`
	TimeElapsed string         `json:"time_elapsed"`
	Data        *CertTokenData `json:"data"`
}

type CertVerifyQueryData

type CertVerifyQueryData struct {
	AlgorithmBaseResp *struct {
		StatusCode    int    `json:"status_code"`
		StatusMessage string `json:"status_message"`
	} `json:"algorithm_base_resp"`
	BinaryDataBase64 []string `json:"binary_data_base64"`
	Result           bool     `json:"result"`
	Images           *struct {
		ImageBest string `json:"image_best"`
		ImageEnv  string `json:"image_env"`
	} `json:"images"`
	Video             string `json:"video"`
	SourceCompDetails *struct {
		Score      float64 `json:"score"`
		Thresholds *struct {
			E3 float64 `json:"1e-3"`
			E4 float64 `json:"1e-4"`
			E5 float64 `json:"1e-5"`
			E6 float64 `json:"1e-6"`
		} `json:"thresholds"`
	} `json:"source_comp_details"`
	TosData *struct {
		Bucket       string `json:"bucket"`
		ImageEnvKey  string `json:"image_env_key"`
		ImageBestKey string `json:"image_best_key"`
		VideoKey     string `json:"video_key"`
		CertDataKey  string `json:"cert_data_key"`
	} `json:"tos_data"`
	VerifyAlgorithmBaseResp *struct {
		StatusCode    int    `json:"status_code"`
		StatusMessage string `json:"status_message"`
	} `json:"verify_algorithm_base_resp"`
	VerifyReqMeasureInfo *struct {
		MeasureType string `json:"measure_type"`
		Value       int    `json:"value"`
	} `json:"verify_req_measure_info"`
}

type CertVerifyQueryResult

type CertVerifyQueryResult struct {
	ResponseMetadata ResponseMetadata     `json:",omitempty"`
	RequestId        string               `json:"request_id"`
	Code             int                  `json:"code"`
	Message          string               `json:"message"`
	Status           int                  `json:"status"`
	TimeElapsed      string               `json:"time_elapsed"`
	Data             *CertVerifyQueryData `json:"data"`
}

type CreateH5token

type CreateH5token struct {
	ConfigId   string `json:"config_id"`
	StsToken   string `json:"sts_token"`
	Name       string `json:"name"`
	IdCard     string `json:"id_card"`
	BytedToken string `json:"byted_token"`
	//Returnurl  string `json:"returnurl"`
	Url string `json:"url"`
}

type Credentials

type Credentials struct {
	CurrentTime     string
	ExpiredTime     string
	AccessKeyId     string
	SecretAccessKey string
	SessionToken    string
}

type ErrorObj

type ErrorObj struct {
	CodeN   int
	Code    string
	Message string
}

type HsClent

type HsClent struct {
	AccessKeyID     string
	AccessKeySecret string
	RoleTrn         string
	NotifyUrl       string
	Sts             *Credentials
	ExpiredTime     int64 //过期时间12个小时
	Un              sync.Mutex
}

func F新建链接

func F新建链接(ak, sk, role, NotifyUrl string) *HsClent

func (*HsClent) FH5套餐配置

func (a *HsClent) FH5套餐配置(sts *Credentials, returnurl string) (config_id string, err error)

func (*HsClent) Fh5token

func (a *HsClent) Fh5token(body *CreateH5token) (bytedToken string, err error)

func (*HsClent) F发送请求

func (a *HsClent) F发送请求(method, addr, service string, sts *Credentials, queries url.Values, body []byte) (by []byte, err error)

func (*HsClent) F新建人脸识别

func (a *HsClent) F新建人脸识别(name, idcard, returnurl string) (h5body *CreateH5token, err error)

func (*HsClent) F查询人脸结果

func (a *HsClent) F查询人脸结果(id string) (data *CertVerifyQueryData, err error)

func (*HsClent) F获取token

func (a *HsClent) F获取token() (sts *Credentials, err error)

type ResponseMetadata

type ResponseMetadata struct {
	RequestId string
	Service   string    `json:",omitempty"`
	Region    string    `json:",omitempty"`
	Action    string    `json:",omitempty"`
	Version   string    `json:",omitempty"`
	Error     *ErrorObj `json:",omitempty"`
}

Jump to

Keyboard shortcuts

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