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.
24 lines
455 B
24 lines
455 B
package v1 |
|
|
|
import ( |
|
"context" |
|
|
|
"go-common/library/net/rpc/warden" |
|
|
|
"google.golang.org/grpc" |
|
) |
|
|
|
// . |
|
const ( |
|
DiscoveryID = "push.service.broadcast" |
|
) |
|
|
|
// NewClient . |
|
func NewClient(conf *warden.ClientConfig, opts ...grpc.DialOption) (ZergClient, error) { |
|
client := warden.NewClient(conf, opts...) |
|
cc, err := client.Dial(context.Background(), "discovery://default/"+DiscoveryID) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return NewZergClient(cc), nil |
|
}
|
|
|