go-common/app/interface/main/broadcast/api/grpc/v1/client.go

20 lines
396 B
Go
Raw Normal View History

2019-04-22 10:49:16 +00:00
package v1
import (
"context"
"go-common/library/net/rpc/warden"
"google.golang.org/grpc"
)
// NewClient new a client.
func NewClient(target string, cfg *warden.ClientConfig, opts ...grpc.DialOption) (ZergClient, error) {
client := warden.NewClient(cfg, opts...)
cc, err := client.Dial(context.Background(), target)
if err != nil {
return nil, err
}
return NewZergClient(cc), nil
}