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.
27 lines
528 B
27 lines
528 B
package v1 |
|
|
|
import ( |
|
"context" |
|
|
|
"google.golang.org/grpc" |
|
|
|
"go-common/library/net/rpc/warden" |
|
) |
|
|
|
const AppID = "live.xanchor" |
|
|
|
type Client struct { |
|
XAnchorClient |
|
} |
|
|
|
// NewClient new anchor grpc client |
|
func NewClient(cfg *warden.ClientConfig, opts ...grpc.DialOption) (*Client, error) { |
|
client := warden.NewClient(cfg, opts...) |
|
conn, err := client.Dial(context.Background(), "discovery://default/"+AppID) |
|
if err != nil { |
|
return nil, err |
|
} |
|
cli := &Client{} |
|
cli.XAnchorClient = NewXAnchorClient(conn) |
|
return cli, nil |
|
}
|
|
|