chain-dci/pkg/bccr/bccr.go

25 lines
616 B
Go
Raw Permalink Normal View History

2025-02-18 06:59:26 +00:00
package bccr
2023-11-23 12:06:14 +00:00
import (
dciConfig "chain-dci/config"
bccrClient "github.com/antchain-openapi-sdk-go/bccr/client"
"github.com/google/wire"
)
2025-02-18 06:59:26 +00:00
var Provider = wire.NewSet(NewBccrClient)
2023-11-23 12:06:14 +00:00
2025-02-18 06:59:26 +00:00
func NewBccrClient() *bccrClient.Client {
2023-11-23 12:06:14 +00:00
// Endpoint 请参考 https://api.aliyun.com/product/rtc
bccrConfig := new(bccrClient.Config)
2025-02-18 06:56:37 +00:00
bccrConfig.SetEndpoint(dciConfig.Data.BccrYXT.EndPoint)
bccrConfig.SetAccessKeyId(dciConfig.Data.BccrYXT.AccessKeyID)
bccrConfig.SetAccessKeySecret(dciConfig.Data.BccrYXT.AccessKeySecret)
2023-11-23 12:06:14 +00:00
client, err := bccrClient.NewClient(bccrConfig)
if err != nil {
panic(err)
}
return client
}