You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
607 B
Go

10 months ago
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
}