Initial commit

This commit is contained in:
Donny
2019-04-22 20:46:32 +08:00
commit 49ab8aadd1
25441 changed files with 4055000 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
package v1
import (
"context"
"fmt"
"go-common/library/net/rpc/warden"
"google.golang.org/grpc"
)
// DiscoveryAppID .
const DiscoveryAppID = "main.archive.creative"
// NewClient new grpc client
func NewClient(cfg *warden.ClientConfig, opts ...grpc.DialOption) (CreativeClient, error) {
client := warden.NewClient(cfg, opts...)
// cc, err := client.Dial(context.Background(), "127.0.0.1:9000")
cc, err := client.Dial(context.Background(), fmt.Sprintf("discovery://default/%s", DiscoveryAppID))
if err != nil {
return nil, err
}
return NewCreativeClient(cc), nil
}