You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
package gift
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
v1 "git.gz.internal.jumaiyx.cn/jm/jmproto/gift/v1"
|
|
|
|
"git.gz.internal.jumaiyx.cn/pkg/k8s-client"
|
|
|
|
"git.gz.internal.jumaiyx.cn/pkg/kubediscovery"
|
|
|
|
"git.gz.internal.jumaiyx.cn/pkg/log"
|
|
|
|
)
|
|
|
|
|
|
|
|
func NewGiftService(log log.Logger) (v1.GiftClient, error) {
|
|
|
|
discovery, err := kubediscovery.Discovery(context.TODO(), log, "gift-service", kubediscovery.Namespace(k8sclient.DevNamespace))
|
|
|
|
if err != nil {
|
|
|
|
log.Errorf("Connect room service failed:%v", err)
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
return v1.NewGiftClient(discovery), nil
|
|
|
|
}
|