chain-dci/pkg/bccr/bccr.go
jhc 5b8bd16642
Some checks failed
continuous-integration/drone Build is failing
首次打包
2023-12-05 15:31:26 +08:00

25 lines
607 B
Go

package bccr
import (
dciConfig "chain-dci/config"
bccrClient "github.com/antchain-openapi-sdk-go/bccr/client"
"github.com/google/wire"
)
var Provider = wire.NewSet(NewBccrClient)
func NewBccrClient() *bccrClient.Client {
// Endpoint 请参考 https://api.aliyun.com/product/rtc
bccrConfig := new(bccrClient.Config)
bccrConfig.SetEndpoint(dciConfig.Data.Bccr.EndPoint)
bccrConfig.SetAccessKeyId(dciConfig.Data.Bccr.AccessKeyID)
bccrConfig.SetAccessKeySecret(dciConfig.Data.Bccr.AccessKeySecret)
client, err := bccrClient.NewClient(bccrConfig)
if err != nil {
panic(err)
}
return client
}