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.
22 lines
493 B
22 lines
493 B
package v1 |
|
|
|
import ( |
|
"context" |
|
|
|
"go-common/library/net/rpc/warden" |
|
|
|
"google.golang.org/grpc" |
|
) |
|
|
|
// AppID unique app id for service discovery |
|
const AppID = "archive.service.up" |
|
|
|
// NewClient new member grpc client |
|
func NewClient(cfg *warden.ClientConfig, opts ...grpc.DialOption) (UpClient, error) { |
|
client := warden.NewClient(cfg, opts...) |
|
conn, err := client.Dial(context.Background(), "discovery://default/"+AppID) |
|
if err != nil { |
|
return nil, err |
|
} |
|
return NewUpClient(conn), nil |
|
}
|
|
|