12345678910111213141516171819202122 |
- package v1
- import (
- "context"
- "go-common/library/net/rpc/warden"
- "google.golang.org/grpc"
- )
- // AppID unique app id for service discovery
- const AppID = "ugcpay.service.rank"
- // NewClient new identify grpc client
- func NewClient(cfg *warden.ClientConfig, opts ...grpc.DialOption) (UGCPayRankClient, error) {
- client := warden.NewClient(cfg, opts...)
- conn, err := client.Dial(context.Background(), "discovery://default/"+AppID)
- if err != nil {
- return nil, err
- }
- return NewUGCPayRankClient(conn), nil
- }
|